Class: Gollum::Wiki
- Inherits:
-
Object
- Object
- Gollum::Wiki
- Defined in:
- lib/smeagol/gollum/wiki.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#file_list(ref) ⇒ Object
Fill an array with a list of files.
-
#files(treeish = nil) ⇒ Object
Lists all non-page files for this wiki.
Instance Method Details
#file_list(ref) ⇒ Object
Fill an array with a list of files.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/smeagol/gollum/wiki.rb', line 18 def file_list(ref) if sha = @access.ref_to_sha(ref) commit = @access.commit(sha) tree_map_for(sha).inject([]) do |list, entry| next list if @page_class.valid_page_name?(entry.name) list << entry.file(self, commit) end else [] end end |
#files(treeish = nil) ⇒ Object
Lists all non-page files for this wiki.
9 10 11 |
# File 'lib/smeagol/gollum/wiki.rb', line 9 def files(treeish = nil) file_list(treeish || @ref) end |