Permalink
Browse files

Corrected if .. elsif .. else in RDoc::Generator::SDoc#index_path

  • Loading branch information...
1 parent fadc362 commit 1eeb2e7b3cb2d9e073b7408bc0e12fce2078fdcf @pda pda committed Sep 16, 2011
Showing with 4 additions and 8 deletions.
  1. +4 −8 lib/sdoc/generator.rb
View
@@ -366,15 +366,11 @@ def index_path
default = @files.first.path
return default unless @options.main_page
- main_page = @options.main_page.dup
-
# Transform class name to file path
- if main_page.include?("::")
- slashed = main_page.sub(/^::/, "").gsub("::", "/")
- main_page = "%s/%s.html" % [ class_dir, slashed ]
- end
-
- if file = @files.find { |f| f.full_name == main_page }
+ if @options.main_page.include?("::")
+ slashed = @options.main_page.sub(/^::/, "").gsub("::", "/")
+ "%s/%s.html" % [ class_dir, slashed ]
+ elsif file = @files.find { |f| f.full_name == @options.main_page }
file.path
else
default

0 comments on commit 1eeb2e7

Please sign in to comment.