summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-09-27 16:26:11 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-09-27 16:26:11 -0700
commit1e1b03f061be4333e2d2a8a4b2b176bcab20a023 (patch)
tree058504f8c6847eb90acec13c65015f5c4df88526 /lib
parent46ffb85fe466efd9dbcac74612efeb4fbd89d96d (diff)
downloadpsych-1e1b03f061be4333e2d2a8a4b2b176bcab20a023.zip
moving handler
Diffstat (limited to 'lib')
-rw-r--r--lib/psych.rb1
-rw-r--r--lib/psych/handler.rb63
-rw-r--r--lib/psych/parser.rb2
-rw-r--r--lib/psych/parser/handler.rb65
4 files changed, 64 insertions, 67 deletions
diff --git a/lib/psych.rb b/lib/psych.rb
index 0151e9f..9d136d5 100644
--- a/lib/psych.rb
+++ b/lib/psych.rb
@@ -1,3 +1,4 @@
+require 'psych/handler'
require 'psych/parser'
require 'psych/psych'
diff --git a/lib/psych/handler.rb b/lib/psych/handler.rb
new file mode 100644
index 0000000..5324174
--- /dev/null
+++ b/lib/psych/handler.rb
@@ -0,0 +1,63 @@
+module Psych
+ ###
+ # Default event handlers used in conjunction with Psych::Parser
+ class Handler
+ ###
+ # Called with +encoding+ when the YAML stream starts.
+ def start_stream encoding
+ end
+
+ ###
+ # Called when the document starts with the declared +version+,
+ # +tag_directives+, if the document is +implicit+
+ def start_document version = [], tag_directives = [], implicit = true
+ end
+
+ ###
+ # Called with the document ends.
+ def end_document implicit = true
+ end
+
+ ###
+ # Called when an alias is found to +anchor+
+ def alias anchor
+ end
+
+ ###
+ # Called when a scalar +value+ is found. The scalar may have an
+ # +anchor+, a +tag+, be implicitly +plain+ or implicitly +quoted+
+ def scalar value, anchor = nil, tag = nil, plain = true, quoted = true, style = ANY_SCALAR_STYLE
+ end
+
+ ###
+ # Called when a sequence is started.
+ def start_sequence anchor = nil, tag = nil, implicit = true, style = BLOCK_SEQUENCE_STYLE
+ end
+
+ ###
+ # Called when a sequence ends.
+ def end_sequence
+ end
+
+ ###
+ # Called when a map starts
+ def start_mapping anchor = nil, tag = nil, implicit = true, style = BLOCK_MAPPING_STYLE
+ end
+
+ ###
+ # Called when a map ends
+ def end_mapping
+ end
+
+ ###
+ # Called when an empty event happens. (Which, as far as I can tell, is
+ # never).
+ def empty
+ end
+
+ ###
+ # Called when the YAML stream ends
+ def end_stream
+ end
+ end
+end
diff --git a/lib/psych/parser.rb b/lib/psych/parser.rb
index 736521f..a59c435 100644
--- a/lib/psych/parser.rb
+++ b/lib/psych/parser.rb
@@ -1,5 +1,3 @@
-require 'psych/parser/handler'
-
module Psych
###
# YAML parser class.
diff --git a/lib/psych/parser/handler.rb b/lib/psych/parser/handler.rb
deleted file mode 100644
index 8bfdb1a..0000000
--- a/lib/psych/parser/handler.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-module Psych
- class Parser
- ###
- # Default event handlers used in conjunction with Psych::Parser
- class Handler
- ###
- # Called with +encoding+ when the YAML stream starts.
- def start_stream encoding
- end
-
- ###
- # Called when the document starts with the declared +version+,
- # +tag_directives+, if the document is +implicit+
- def start_document version = [], tag_directives = [], implicit = true
- end
-
- ###
- # Called with the document ends.
- def end_document implicit = true
- end
-
- ###
- # Called when an alias is found to +anchor+
- def alias anchor
- end
-
- ###
- # Called when a scalar +value+ is found. The scalar may have an
- # +anchor+, a +tag+, be implicitly +plain+ or implicitly +quoted+
- def scalar value, anchor = nil, tag = nil, plain = true, quoted = true, style = ANY_SCALAR_STYLE
- end
-
- ###
- # Called when a sequence is started.
- def start_sequence anchor = nil, tag = nil, implicit = true, style = BLOCK_SEQUENCE_STYLE
- end
-
- ###
- # Called when a sequence ends.
- def end_sequence
- end
-
- ###
- # Called when a map starts
- def start_mapping anchor = nil, tag = nil, implicit = true, style = BLOCK_MAPPING_STYLE
- end
-
- ###
- # Called when a map ends
- def end_mapping
- end
-
- ###
- # Called when an empty event happens. (Which, as far as I can tell, is
- # never).
- def empty
- end
-
- ###
- # Called when the YAML stream ends
- def end_stream
- end
- end
- end
-end