lib/review/tocprinter.rb in review-1.2.0 vs lib/review/tocprinter.rb in review-1.3.0
- old
+ new
@@ -23,36 +23,36 @@
99 # no one use 99 level nest
end
def initialize(print_upper, param)
@print_upper = print_upper
- @param = param
+ @config = param
end
def print?(level)
level <= @print_upper
end
def nkffilter(line)
inc = ""
outc = "-w"
- if @param["inencoding"] =~ /^EUC$/
+ if @config["inencoding"] =~ /^EUC$/
inc = "-E"
- elsif @param["inencoding"] =~ /^SJIS$/
+ elsif @config["inencoding"] =~ /^SJIS$/
inc = "-S"
- elsif @param["inencoding"] =~ /^JIS$/
+ elsif @config["inencoding"] =~ /^JIS$/
inc = "-J"
end
-
- if @param["outencoding"] =~ /^EUC$/
+
+ if @config["outencoding"] =~ /^EUC$/
outc = "-e"
- elsif @param["outencoding"] =~ /^SJIS$/
+ elsif @config["outencoding"] =~ /^SJIS$/
outc = "-s"
- elsif @param["outencoding"] =~ /^JIS$/
+ elsif @config["outencoding"] =~ /^JIS$/
outc = "-j"
end
-
+
NKF.nkf("#{inc} #{outc}", line)
end
end
@@ -124,12 +124,12 @@
else
html << chapter_to_s(chap)
end
end
end
- puts HTMLLayout.new({ :body => html,
- :title => "目次",
- :template => File.join(book.basedir, "layouts", "layout.erb")}).result
+ puts HTMLLayout.new(
+ {'body' => html, 'title' => "目次"},
+ File.join(book.basedir, "layouts", "layout.erb")).result
end
private
def chap_sections_to_s(chap)