aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/vendor/builder/xmlevents.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-10-07 01:05:42 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-10-07 01:05:42 +0000
commit1f5c4365a7429d7f5de0f515b89761434a159d99 (patch)
tree9862da02a946e3fde47803216a23fbe18a4c4a77 /activesupport/lib/active_support/vendor/builder/xmlevents.rb
parent52ca5dad1ecf64ff508a4f16202171693921890f (diff)
downloadrails-1f5c4365a7429d7f5de0f515b89761434a159d99.tar.gz
rails-1f5c4365a7429d7f5de0f515b89761434a159d99.tar.bz2
rails-1f5c4365a7429d7f5de0f515b89761434a159d99.zip
Unbundle Builder in favor of a gem dependency.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7761 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/vendor/builder/xmlevents.rb')
-rw-r--r--activesupport/lib/active_support/vendor/builder/xmlevents.rb63
1 files changed, 0 insertions, 63 deletions
diff --git a/activesupport/lib/active_support/vendor/builder/xmlevents.rb b/activesupport/lib/active_support/vendor/builder/xmlevents.rb
deleted file mode 100644
index 15dc7b6421..0000000000
--- a/activesupport/lib/active_support/vendor/builder/xmlevents.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env ruby
-
-#--
-# Copyright 2004 by Jim Weirich (jim@weirichhouse.org).
-# All rights reserved.
-
-# Permission is granted for use, copying, modification, distribution,
-# and distribution of modified versions of this work as long as the
-# above copyright notice is included.
-#++
-
-require 'builder/xmlmarkup'
-
-module Builder
-
- # Create a series of SAX-like XML events (e.g. start_tag, end_tag)
- # from the markup code. XmlEvent objects are used in a way similar
- # to XmlMarkup objects, except that a series of events are generated
- # and passed to a handler rather than generating character-based
- # markup.
- #
- # Usage:
- # xe = Builder::XmlEvents.new(hander)
- # xe.title("HI") # Sends start_tag/end_tag/text messages to the handler.
- #
- # Indentation may also be selected by providing value for the
- # indentation size and initial indentation level.
- #
- # xe = Builder::XmlEvents.new(handler, indent_size, initial_indent_level)
- #
- # == XML Event Handler
- #
- # The handler object must expect the following events.
- #
- # [<tt>start_tag(tag, attrs)</tt>]
- # Announces that a new tag has been found. +tag+ is the name of
- # the tag and +attrs+ is a hash of attributes for the tag.
- #
- # [<tt>end_tag(tag)</tt>]
- # Announces that an end tag for +tag+ has been found.
- #
- # [<tt>text(text)</tt>]
- # Announces that a string of characters (+text+) has been found.
- # A series of characters may be broken up into more than one
- # +text+ call, so the client cannot assume that a single
- # callback contains all the text data.
- #
- class XmlEvents < XmlMarkup #:nodoc:
- def text!(text)
- @target.text(text)
- end
-
- def _start_tag(sym, attrs, end_too=false)
- @target.start_tag(sym, attrs)
- _end_tag(sym) if end_too
- end
-
- def _end_tag(sym)
- @target.end_tag(sym)
- end
- end
-
-end