summaryrefslogtreecommitdiffstats
path: root/vendor/gems/coderay-1.0.0/lib/coderay/encoders/xml.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-19 14:42:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-19 14:42:10 +0000
commit28338a6f4a5038d7d054436e0bbae8907fe951fe (patch)
treeb4a86126a0a1ffd216f26e2051fe04d29262b83a /vendor/gems/coderay-1.0.0/lib/coderay/encoders/xml.rb
parent9315039e0a95b0234b7736f359fc039550f45e08 (diff)
downloadredmine-28338a6f4a5038d7d054436e0bbae8907fe951fe.tar.gz
redmine-28338a6f4a5038d7d054436e0bbae8907fe951fe.zip
Removed vendored gems (#5638).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8905 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'vendor/gems/coderay-1.0.0/lib/coderay/encoders/xml.rb')
-rw-r--r--vendor/gems/coderay-1.0.0/lib/coderay/encoders/xml.rb72
1 files changed, 0 insertions, 72 deletions
diff --git a/vendor/gems/coderay-1.0.0/lib/coderay/encoders/xml.rb b/vendor/gems/coderay-1.0.0/lib/coderay/encoders/xml.rb
deleted file mode 100644
index 3d306a608..000000000
--- a/vendor/gems/coderay-1.0.0/lib/coderay/encoders/xml.rb
+++ /dev/null
@@ -1,72 +0,0 @@
-module CodeRay
-module Encoders
-
- # = XML Encoder
- #
- # Uses REXML. Very slow.
- class XML < Encoder
-
- register_for :xml
-
- FILE_EXTENSION = 'xml'
-
- autoload :REXML, 'rexml/document'
-
- DEFAULT_OPTIONS = {
- :tab_width => 8,
- :pretty => -1,
- :transitive => false,
- }
-
- protected
- def setup options
- super
-
- @doc = REXML::Document.new
- @doc << REXML::XMLDecl.new
- @tab_width = options[:tab_width]
- @root = @node = @doc.add_element('coderay-tokens')
- end
-
- def finish options
- @doc.write @out, options[:pretty], options[:transitive], true
-
- super
- end
-
- public
- def text_token text, kind
- if kind == :space
- token = @node
- else
- token = @node.add_element kind.to_s
- end
- text.scan(/(\x20+)|(\t+)|(\n)|[^\x20\t\n]+/) do |space, tab, nl|
- case
- when space
- token << REXML::Text.new(space, true)
- when tab
- token << REXML::Text.new(tab, true)
- when nl
- token << REXML::Text.new(nl, true)
- else
- token << REXML::Text.new($&)
- end
- end
- end
-
- def begin_group kind
- @node = @node.add_element kind.to_s
- end
-
- def end_group kind
- if @node == @root
- raise 'no token to close!'
- end
- @node = @node.parent
- end
-
- end
-
-end
-end