summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders/helpers/html_output.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2005-10-16 10:50:34 +0000
committermurphy <murphy@rubychan.de>2005-10-16 10:50:34 +0000
commita4052158f89068317e5a374cc553ef95de1a842a (patch)
tree19727dcdbac840d562279e876ddfafa00a52dc95 /lib/coderay/encoders/helpers/html_output.rb
parent48e144a20829faaeca9a7db8fbc6128f1f5d7297 (diff)
downloadcoderay-a4052158f89068317e5a374cc553ef95de1a842a.tar.gz
scanners/ruby.rb: fixed string inline code
encoders/helpers/html_css.rb and html_helper.rb: added :inline token encoders/helpers/html_output.rb: made wrapped_in an attr_accessor; fixed option handling in numerize!
Diffstat (limited to 'lib/coderay/encoders/helpers/html_output.rb')
-rw-r--r--lib/coderay/encoders/helpers/html_output.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/coderay/encoders/helpers/html_output.rb b/lib/coderay/encoders/helpers/html_output.rb
index f6a2b11..849fe1a 100644
--- a/lib/coderay/encoders/helpers/html_output.rb
+++ b/lib/coderay/encoders/helpers/html_output.rb
@@ -13,6 +13,8 @@ module CodeRay
# TODO: more doc.
module Output
+ attr_accessor :wrapped_in
+
class << self
# This makes Output look like a class.
@@ -53,11 +55,6 @@ module CodeRay
wrapper :div, :span, :page
- def wrapped_in
- @wrapped_in ||= nil
- end
- attr_writer :wrapped_in
-
def wrapped_in? element
wrapped_in == element
end
@@ -100,7 +97,9 @@ module CodeRay
def numerize! mode = :table, options = {}
return self unless mode
- start = options.fetch :line_number_start, DEFAULT_OPTIONS[:line_number_start]
+ options = DEFAULT_OPTIONS.merge options
+
+ start = options[:line_number_start]
unless start.is_a? Integer
raise ArgumentError, "Invalid value %p for :line_number_start; Integer expected." % start
end
@@ -109,7 +108,7 @@ module CodeRay
raise ArgumentError, "Can't numerize, :wrap must be in %p, but is %p" % [NUMERIZABLE_WRAPPINGS, options[:wrap]]
end
- bold_every = options.fetch :bold_every, DEFAULT_OPTIONS[:bold_every]
+ bold_every = options[:bold_every]
bolding =
if bold_every == :no_bolding or bold_every == 0
proc { |line| line.to_s }