Permalink
Browse files

Switching out this defaults variable and directly merging options

  • Loading branch information...
1 parent 9ec2a9f commit 0ba9fa3bed6398b76bed653fb95fe9071a89fbef Kurtis Rainbolt-Greene committed Jan 9, 2012
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/rocco.rb
View
@@ -86,13 +86,12 @@ def initialize(filename, sources=[], options={})
# the file is read to retrieve data.
@data = if block_given? then yield else File.read(filename) end
- defaults = {
+ @options = {
:language => 'ruby',
:comment_chars => '#',
:template_file => nil,
- :stylesheet => 'http://jashkenas.github.com/docco/resources/docco.css'
- }
- @options = defaults.merge(options)
+ :stylesheet => 'http://jashkenas.github.com/docco/resources/docco.css'
+ }.merge(options)
# If we detect a language
if "text" != detect_language
@@ -103,7 +102,7 @@ def initialize(filename, sources=[], options={})
# If we didn't detect a language, but the user provided one, use it
# to look around for comment characters to override the default.
- elsif @options[:language] != defaults[:language]
+ elsif @options[:language]
@options[:comment_chars] = generate_comment_chars
# If neither is true, then convert the default comment character string

0 comments on commit 0ba9fa3

Please sign in to comment.