sdoc 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/lib/sdoc/generator.rb +15 -6
  2. data/sdoc.gemspec +1 -1
  3. metadata +3 -4
  4. data/VERSION.yml +0 -5
@@ -355,12 +355,22 @@ class RDoc::Generator::SDoc
355
355
  end
356
356
  end
357
357
 
358
- def index_file
359
- if @options.main_page && file = @files.find { |f| f.full_name == @options.main_page }
360
- file
361
- else
362
- @files.first
358
+ ### Determines index path based on @options.main_page (or lack thereof)
359
+ def index_path
360
+ # Break early to avoid a big if block when no main page is specified
361
+ default = @files.first.path
362
+ return default unless @options.main_page
363
+
364
+ # Handle attempts to hit class docs directly
365
+ if @options.main_page.include?("::")
366
+ return "%s/%s.html" % [class_dir, @options.main_page.gsub("::", "/")]
367
+ end
368
+ if file = @files.find { |f| f.full_name == @options.main_page }
369
+ return file.path
363
370
  end
371
+
372
+ # Nothing else worked, so stick with the default
373
+ return default
364
374
  end
365
375
 
366
376
  ### Create index.html with frameset
@@ -368,7 +378,6 @@ class RDoc::Generator::SDoc
368
378
  debug_msg "Generating index file in #@outputdir"
369
379
  templatefile = @template_dir + 'index.rhtml'
370
380
  outfile = @outputdir + 'index.html'
371
- index_path = index_file.path
372
381
 
373
382
  self.render_template( templatefile, binding(), outfile )
374
383
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "sdoc"
5
- s.version = "0.3.7"
5
+ s.version = "0.3.8"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Vladimir Kolesnikov"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdoc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 7
10
- version: 0.3.7
9
+ - 8
10
+ version: 0.3.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Vladimir Kolesnikov
@@ -77,7 +77,6 @@ files:
77
77
  - LICENSE
78
78
  - README.rdoc
79
79
  - Rakefile
80
- - VERSION.yml
81
80
  - bin/sdoc
82
81
  - bin/sdoc-merge
83
82
  - lib/rdoc/discover.rb
@@ -1,5 +0,0 @@
1
- ---
2
- :patch: 0
3
- :major: 0
4
- :build:
5
- :minor: 3