Class: GithubIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/gitindex.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_dir = "~") ⇒ GithubIndex

Returns a new instance of GithubIndex.



5
6
7
8
9
# File 'lib/gitindex.rb', line 5

def initialize(base_dir = "~")
  @base_dir = base_dir
  @path = ""
  @index = ""
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/gitindex.rb', line 3

def path
  @path
end

Instance Method Details

#generate_indexObject



11
12
13
14
15
16
17
# File 'lib/gitindex.rb', line 11

def generate_index
  puts write_header
  puts "Reading from #{@base_dir}"
  process_directory(@base_dir)
  puts "<ul>#{@index}</ul>"
  puts write_footer
end