Class | Nukumi2::Blog |
In: |
lib/nukumi2.rb
|
Parent: | Object |
categories | [R] | |
hidden | [R] |
# File lib/nukumi2.rb, line 109 109: def fetch(path) 110: flavor = default_flavor 111: 112: path.gsub!(/\/index\b/, '/') 113: path = path.gsub(/\.(.*?)$/) { flavor = $1; '' } 114: 115: find_view(path).new(registry, path).to_page(flavor) 116: end
# File lib/nukumi2.rb, line 118 118: def find_view(path) 119: path = path + "/" if path[-1] != ?/ 120: 121: best_topic = topictree.find_most_specific path, @publishable.keys 122: 123: raise NotFound unless best_topic 124: @publishable[best_topic] 125: end
# File lib/nukumi2.rb, line 74 74: def get_categories 75: @publishable = {} 76: @hidden = [] 77: 78: config.get_topics.each { |topic, options| 79: if options.title && topic !~ /\*/ 80: topictree.create(topic, options.title, options.description) 81: end 82: 83: if options.view 84: @publishable[topic] = View.const_get(options.view) 85: end 86: 87: @hidden << topic if options.hidden == true 88: } 89: end
# File lib/nukumi2.rb, line 66 66: def get_entries 67: @entries = all_backends.map { |b| b.get }.flatten.uniq 68: end
# File lib/nukumi2.rb, line 103 103: def insert_entries 104: @entries.each { |entry| 105: entry.insert_into_topictree topictree 106: } 107: end