From cce3ef21e491ac23c4aeae1c926ed074803ec465 Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 29 Jun 2010 07:12:34 +0000 Subject: General cleanup in this weird Encoders::HTML::Output module. --- lib/coderay/encoders/html/output.rb | 62 ++++++------------------------------- 1 file changed, 10 insertions(+), 52 deletions(-) (limited to 'lib/coderay') diff --git a/lib/coderay/encoders/html/output.rb b/lib/coderay/encoders/html/output.rb index dec1d7c..40e3b04 100644 --- a/lib/coderay/encoders/html/output.rb +++ b/lib/coderay/encoders/html/output.rb @@ -17,26 +17,13 @@ module Encoders class << self - # This makes Output look like a class. - # - # Example: - # - # a = Output.new 'Code' - # a.wrap! :page - def new string, css = CSS.new, element = nil - output = string.clone.extend self - output.wrapped_in = element - output.css = css - output - end - # Raises an exception if an object that doesn't respond to to_str is extended by Output, # to prevent users from misuse. Use Module#remove_method to disable. - def extended o + def extended o # :nodoc: warn "The Output module is intended to extend instances of String, not #{o.class}." unless o.respond_to? :to_str end - def make_stylesheet css, in_tag = false + def make_stylesheet css, in_tag = false # :nodoc: sheet = css.stylesheet sheet = <<-CSS if in_tag