diff options
Diffstat (limited to 'ruby_2_2/ext/psych/lib/psych/json')
-rw-r--r-- | ruby_2_2/ext/psych/lib/psych/json/ruby_events.rb | 19 | ||||
-rw-r--r-- | ruby_2_2/ext/psych/lib/psych/json/stream.rb | 16 | ||||
-rw-r--r-- | ruby_2_2/ext/psych/lib/psych/json/tree_builder.rb | 12 | ||||
-rw-r--r-- | ruby_2_2/ext/psych/lib/psych/json/yaml_events.rb | 29 |
4 files changed, 0 insertions, 76 deletions
diff --git a/ruby_2_2/ext/psych/lib/psych/json/ruby_events.rb b/ruby_2_2/ext/psych/lib/psych/json/ruby_events.rb deleted file mode 100644 index 6b73249c06..0000000000 --- a/ruby_2_2/ext/psych/lib/psych/json/ruby_events.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Psych - module JSON - module RubyEvents # :nodoc: - def visit_Time o - formatted = format_time o - @emitter.scalar formatted, nil, nil, false, true, Nodes::Scalar::DOUBLE_QUOTED - end - - def visit_DateTime o - visit_Time o.to_time - end - - def visit_String o - @emitter.scalar o.to_s, nil, nil, false, true, Nodes::Scalar::DOUBLE_QUOTED - end - alias :visit_Symbol :visit_String - end - end -end diff --git a/ruby_2_2/ext/psych/lib/psych/json/stream.rb b/ruby_2_2/ext/psych/lib/psych/json/stream.rb deleted file mode 100644 index fe2a6e9116..0000000000 --- a/ruby_2_2/ext/psych/lib/psych/json/stream.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'psych/json/ruby_events' -require 'psych/json/yaml_events' - -module Psych - module JSON - class Stream < Psych::Visitors::JSONTree - include Psych::JSON::RubyEvents - include Psych::Streaming - extend Psych::Streaming::ClassMethods - - class Emitter < Psych::Stream::Emitter # :nodoc: - include Psych::JSON::YAMLEvents - end - end - end -end diff --git a/ruby_2_2/ext/psych/lib/psych/json/tree_builder.rb b/ruby_2_2/ext/psych/lib/psych/json/tree_builder.rb deleted file mode 100644 index b799c93f58..0000000000 --- a/ruby_2_2/ext/psych/lib/psych/json/tree_builder.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'psych/json/yaml_events' - -module Psych - module JSON - ### - # Psych::JSON::TreeBuilder is an event based AST builder. Events are sent - # to an instance of Psych::JSON::TreeBuilder and a JSON AST is constructed. - class TreeBuilder < Psych::TreeBuilder - include Psych::JSON::YAMLEvents - end - end -end diff --git a/ruby_2_2/ext/psych/lib/psych/json/yaml_events.rb b/ruby_2_2/ext/psych/lib/psych/json/yaml_events.rb deleted file mode 100644 index d054d9b458..0000000000 --- a/ruby_2_2/ext/psych/lib/psych/json/yaml_events.rb +++ /dev/null @@ -1,29 +0,0 @@ -module Psych - module JSON - module YAMLEvents # :nodoc: - def start_document version, tag_directives, implicit - super(version, tag_directives, !streaming?) - end - - def end_document implicit_end = !streaming? - super(implicit_end) - end - - def start_mapping anchor, tag, implicit, style - super(anchor, nil, true, Nodes::Mapping::FLOW) - end - - def start_sequence anchor, tag, implicit, style - super(anchor, nil, true, Nodes::Sequence::FLOW) - end - - def scalar value, anchor, tag, plain, quoted, style - if "tag:yaml.org,2002:null" == tag - super('null', nil, nil, true, false, Nodes::Scalar::PLAIN) - else - super - end - end - end - end -end |