Searched refs:Psych (Results 1 - 25 of 84) sorted by relevance

1234

/macosx-10.9.5/ruby-104/ruby/ext/psych/lib/psych/json/
H A Dtree_builder.rb3 module Psych module
6 # Psych::JSON::TreeBuilder is an event based AST builder. Events are sent
7 # to an instance of Psych::JSON::TreeBuilder and a JSON AST is constructed.
8 class TreeBuilder < Psych::TreeBuilder
9 include Psych::JSON::YAMLEvents
H A Dstream.rb4 module Psych module
6 class Stream < Psych::Visitors::JSONTree
7 include Psych::JSON::RubyEvents
8 include Psych::Streaming
10 class Emitter < Psych::Stream::Emitter # :nodoc:
11 include Psych::JSON::YAMLEvents
/macosx-10.9.5/ruby-104/ruby/ext/psych/lib/psych/
H A Dnodes.rb9 module Psych module
13 # When using Psych.load to deserialize a YAML document, the document is
17 # In the opposite direction, when using Psych.dump, the Ruby object graph is
21 # Psych::Nodes contains all of the classes that make up the nodes of a YAML
23 # Psych::Visitors) to convert that AST to either a YAML document or to a
30 # stream = Psych::Nodes::Stream.new
31 # doc = Psych::Nodes::Document.new
32 # seq = Psych::Nodes::Sequence.new
33 # scalar = Psych::Nodes::Scalar.new('foo')
50 # A valid YAML AST *must* have one Psych
[all...]
H A Domap.rb1 module Psych module
H A Dset.rb1 module Psych module
H A Dstream.rb1 module Psych module
3 # Psych::Stream is a streaming YAML emitter. It will not buffer your YAML,
8 # stream = Psych::Stream.new($stdout)
15 # Psych::Stream#start will take a block and ensure that Psych::Stream#finish
18 # stream = Psych::Stream.new($stdout)
23 class Stream < Psych::Visitors::YAMLTree
24 class Emitter < Psych::Emitter # :nodoc:
34 include Psych::Streaming
/macosx-10.9.5/ruby-104/ruby/lib/rubygems/
H A Dpsych_additions.rb6 module Psych module
/macosx-10.9.5/ruby-104/ruby/test/psych/
H A Dtest_scalar.rb5 module Psych module
8 assert_equal "���������", Psych.load("--- ���������")
H A Dtest_nil.rb3 module Psych module
6 yml = Psych.dump nil
8 assert_nil Psych.load(yml)
12 yml = Psych.dump [nil]
14 assert_equal [nil], Psych.load(yml)
H A Dtest_boolean.rb3 module Psych module
10 assert_equal true, Psych.load("--- #{truth}")
16 assert_equal false, Psych.load("--- #{truth}")
24 assert_equal "y", Psych.load("--- y")
25 assert_equal "Y", Psych.load("--- Y")
32 assert_equal "n", Psych.load("--- n")
33 assert_equal "N", Psych.load("--- N")
H A Dtest_json_tree.rb3 module Psych module
6 assert_match(/"foo"/, Psych.to_json("foo"))
10 assert_match(/"foo"/, Psych.to_json(:foo))
14 assert_match(/^null/, Psych.to_json(nil))
18 assert_match(/^10/, Psych.to_json(10))
22 assert_match(/^1.2/, Psych.to_json(1.2))
27 json = Psych.to_json(hash)
41 json = Psych.to_json Bar.new
47 json = Psych.to_json(list)
57 Psych
[all...]
H A Dtest_set.rb3 module Psych module
7 @set = Psych::Set.new
13 assert_match(/!set/, Psych.dump(@set))
23 loaded = Psych.load(<<-eoyml)
32 assert_instance_of(Psych::Set, Psych.load(Psych.dump(@set)))
36 loaded = Psych.load(<<-eoyml)
41 assert_instance_of(Psych::Set, loaded)
H A Dtest_numeric.rb4 module Psych module
20 assert_equal 1.0, Psych.load('--- 1.')
24 str = Psych.load('--- 090')
30 assert_match "!ruby/object:BigDecimal", Psych.dump(decimal)
39 str = Psych.load('--- 4 roses')
41 str = Psych.load('--- 1.1.1')
H A Dtest_null.rb3 module Psych module
9 assert_equal [nil] * 5, Psych.load(<<-eoyml)
H A Dtest_symbol.rb3 module Psych module
14 assert_equal :"1", Psych.load("--- :'1'\n")
H A Dtest_exception.rb3 module Psych module
20 ex = assert_raises(Psych::SyntaxError) do
21 Psych.load '--- `'
25 ex = assert_raises(Psych::SyntaxError) do
26 Psych.load '--- `', 'meow'
32 ex = assert_raises(Psych::SyntaxError) do
33 Psych.parse_stream '--- `'
38 ex = assert_raises(Psych::SyntaxError) do
39 Psych.parse_stream '--- `', 'omg!'
46 ex = assert_raises(Psych
[all...]
H A Dtest_omap.rb3 module Psych module
6 o = Psych.load "--- !!omap\na: 1\nb: 2"
7 assert_kind_of Psych::Omap, o
13 map = Psych::Omap.new
16 assert_equal(map, Psych.load(Psych.dump(map)))
20 map = Psych::Omap.new
26 map = Psych::Omap.new
34 map = Psych::Omap[*list.flatten]
41 map = Psych
[all...]
H A Dtest_string.rb3 module Psych module
19 y = Psych.load Psych.dump Y.new("foo").tap {|y| y.val = 1}
26 x = Psych.load "--- !str:#{X.name} foo\n\n"
32 assert_match "!ruby/string:#{X}", Psych.dump(X.new)
33 x = Psych.load Psych.dump X.new
38 assert_match "!ruby/string:#{Z}", Psych.dump(Z.new)
39 x = Psych.load Psych
[all...]
H A Dtest_hash.rb3 module Psych module
14 assert_match "!ruby/hash:#{X}", Psych.dump(X.new)
15 x = Psych.load Psych.dump X.new
20 x = Psych.load "--- !map:#{X} { }\n"
34 hash = Psych.load(<<-eoyml)
H A Dtest_object.rb3 module Psych module
25 assert_match('foo', Psych.dump(tag))
30 tag2 = Psych.load(Psych.dump(tag))
38 loaded = Psych.load Psych.dump foo
H A Dhelper.rb7 module Psych module
10 # Convert between Psych and the object to verify correct parsing and
14 assert_equal( obj, Psych::load( yaml ) )
15 assert_equal( obj, Psych::parse( yaml ).transform )
16 assert_equal( obj, Psych::load( obj.psych_to_yaml ) )
17 assert_equal( obj, Psych::parse( obj.psych_to_yaml ).transform )
18 assert_equal( obj, Psych::load(
29 assert_equal( obj, Psych::load( yaml ) )
30 assert_equal( obj, Psych::parse( yaml ).transform )
36 assert_equal(obj, Psych
[all...]
/macosx-10.9.5/ruby-104/ruby/ext/psych/lib/psych/nodes/
H A Dstream.rb1 module Psych module
6 # child node for a Psych::Nodes::Stream node is Psych::Nodes::Document.
7 class Stream < Psych::Nodes::Node
9 # Encodings supported by Psych (and libyaml)
12 ANY = Psych::Parser::ANY
15 UTF8 = Psych::Parser::UTF8
18 UTF16LE = Psych::Parser::UTF16LE
21 UTF16BE = Psych::Parser::UTF16BE
27 # Create a new Psych
[all...]
H A Dalias.rb1 module Psych module
7 # A Psych::Nodes::Alias is a terminal node and may have no children.
8 class Alias < Psych::Nodes::Node
/macosx-10.9.5/ruby-104/ruby/test/psych/visitors/
H A Dtest_yaml_tree.rb3 module Psych module
20 e = Psych::Emitter.new io
33 assert_equal Psych::Nodes::Scalar::LITERAL, scalar.style
37 yaml = Psych.dump(Object.new)
38 assert(Psych.dump(Object.new) !~ /Object/, yaml)
55 obj = Psych.load(Psych.dump(s))
61 obj = Psych.load(Psych.dump(s))
67 loaded = Psych
[all...]
/macosx-10.9.5/ruby-104/ruby/ext/psych/lib/psych/visitors/
H A Djson_tree.rb3 module Psych module
6 include Psych::JSON::RubyEvents
8 def initialize options = {}, emitter = Psych::JSON::TreeBuilder.new

Completed in 150 milliseconds

1234