Permalink
Browse files

* Moar bettah.

  • Loading branch information...
1 parent ee77a77 commit 0c5b4b54ee8bad57f65e3277ca56321a40b54ae3 Erik Hollensbe committed Jul 8, 2010
Showing with 8 additions and 17 deletions.
  1. +8 −17 lib/hanna/hanna.rb
View
25 lib/hanna/hanna.rb
@@ -86,26 +86,17 @@ def generate_indexes
@main_page_uri = @files.find { |f| f.name == @options.main_page }.path
File.open(outjoin(INDEX_OUT), 'w') { |f| f << haml_file(templjoin(INDEX_PAGE)).to_html(binding) }
- generate_index FILE_INDEX_OUT, FILE_INDEX, {
- :files => @files,
- :stylesheet => STYLE_OUT,
- :list_title => "File Index"
- }
-
- generate_index CLASS_INDEX_OUT, CLASS_INDEX, {
- :classes => @classes,
- :stylesheet => STYLE_OUT,
- :list_title => "Class Index"
- }
+ generate_index(FILE_INDEX_OUT, FILE_INDEX, 'File', { :files => @files})
+ generate_index(CLASS_INDEX_OUT, CLASS_INDEX, 'Class', { :classes => @classes })
+ generate_index(METHOD_INDEX_OUT, METHOD_INDEX, 'Method', { :methods => @methods })
+ end
- generate_index METHOD_INDEX_OUT, METHOD_INDEX, {
- :methods => @methods,
+ def generate_index(outfile, templfile, index_name, values)
+ values.merge!({
:stylesheet => STYLE_OUT,
- :list_title => "Method Index"
- }
- end
+ :list_title => "#{index_name} Index"
+ })
- def generate_index(outfile, templfile, values)
index = haml_file(templjoin(templfile))
File.open(outjoin(outfile), 'w') do |f|

0 comments on commit 0c5b4b5

Please sign in to comment.