RbYAML 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/LICENSE +19 -0
  2. data/README +31 -0
  3. data/lib/rbyaml.rb +378 -0
  4. data/lib/rbyaml/composer.rb +189 -0
  5. data/lib/rbyaml/constructor.rb +374 -0
  6. data/lib/rbyaml/detector.rb +44 -0
  7. data/lib/rbyaml/dumper.rb +40 -0
  8. data/lib/rbyaml/emitter.rb +1116 -0
  9. data/lib/rbyaml/error.rb +81 -0
  10. data/lib/rbyaml/events.rb +92 -0
  11. data/lib/rbyaml/loader.rb +49 -0
  12. data/lib/rbyaml/nodes.rb +69 -0
  13. data/lib/rbyaml/parser.rb +488 -0
  14. data/lib/rbyaml/reader.rb +127 -0
  15. data/lib/rbyaml/representer.rb +183 -0
  16. data/lib/rbyaml/scanner.rb +1258 -0
  17. data/lib/rbyaml/serializer.rb +120 -0
  18. data/lib/rbyaml/test.rb +56 -0
  19. data/lib/rbyaml/tokens.rb +163 -0
  20. data/lib/rbyaml/yaml.rb +143 -0
  21. data/test/test_rbyaml.rb +18 -0
  22. data/test/yaml/gems.yml +130951 -0
  23. data/test/yaml/gems2.yml +113 -0
  24. data/test/yaml/test1.yml +3 -0
  25. data/test/yaml/test10.yml +8 -0
  26. data/test/yaml/test12.yml +8 -0
  27. data/test/yaml/test13.yml +4 -0
  28. data/test/yaml/test14.yml +4 -0
  29. data/test/yaml/test15.yml +8 -0
  30. data/test/yaml/test16.yml +7 -0
  31. data/test/yaml/test18.yml +6 -0
  32. data/test/yaml/test19.yml +5 -0
  33. data/test/yaml/test2.yml +3 -0
  34. data/test/yaml/test20.yml +6 -0
  35. data/test/yaml/test21.yml +4 -0
  36. data/test/yaml/test22.yml +4 -0
  37. data/test/yaml/test23.yml +13 -0
  38. data/test/yaml/test24.yml +14 -0
  39. data/test/yaml/test25.yml +7 -0
  40. data/test/yaml/test26.yml +7 -0
  41. data/test/yaml/test27.yml +29 -0
  42. data/test/yaml/test28.yml +26 -0
  43. data/test/yaml/test29.yml +13 -0
  44. data/test/yaml/test3.yml +8 -0
  45. data/test/yaml/test30.yml +7 -0
  46. data/test/yaml/test31.yml +2 -0
  47. data/test/yaml/test32.yml +13 -0
  48. data/test/yaml/test33.yml +2 -0
  49. data/test/yaml/test34.yml +8 -0
  50. data/test/yaml/test35.yml +4 -0
  51. data/test/yaml/test36.yml +8 -0
  52. data/test/yaml/test37.yml +2 -0
  53. data/test/yaml/test38.yml +8 -0
  54. data/test/yaml/test39.yml +2 -0
  55. data/test/yaml/test4.yml +8 -0
  56. data/test/yaml/test40.yml +3 -0
  57. data/test/yaml/test41.yml +5 -0
  58. data/test/yaml/test42.yml +12 -0
  59. data/test/yaml/test43.yml +15 -0
  60. data/test/yaml/test44.yml +23 -0
  61. data/test/yaml/test5.yml +3 -0
  62. data/test/yaml/test6.yml +5 -0
  63. data/test/yaml/test7.yml +10 -0
  64. data/test/yaml/test8.yml +10 -0
  65. data/test/yaml/test9.yml +8 -0
  66. metadata +111 -0
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Cache
2
+ gems:
3
+ jabber4r-0.7.0: !ruby/object:Gem::Specification
4
+ rubygems_version: 0.8.11
5
+ specification_version: -1
6
+ name: jabber4r
7
+ version: !ruby/object:Gem::Version
8
+ version: 0.7.0
9
+ date: 2004-03-13 08:39:42.381129 -05:00
10
+ summary: Jabber4r is a pure-Ruby Jabber client library
11
+ require_paths:
12
+ - lib
13
+ email: rich@infoether.com
14
+ homepage: http://jabber4r.rubyforge.org
15
+ rubyforge_project: jabber4r
16
+ description:
17
+ autorequire: jabber4r/jabber4r
18
+ default_executable:
19
+ bindir:
20
+ has_rdoc: true
21
+ required_ruby_version:
22
+ platform:
23
+ signing_key:
24
+ cert_chain: []
25
+
26
+ authors:
27
+ files: []
28
+
29
+ test_files: []
30
+
31
+ rdoc_options: []
32
+
33
+ extra_rdoc_files: []
34
+
35
+ executables:
36
+ extensions:
37
+ requirements:
38
+ - Jabber server
39
+ dependencies:
40
+
41
+ cgikit-1.1.0: !ruby/object:Gem::Specification
42
+ rubygems_version: 0.8.11
43
+ specification_version: -1
44
+ name: cgikit
45
+ version: !ruby/object:Gem::Version
46
+ version: 1.1.0
47
+ date: 2004-03-13 09:24:59.162981 -05:00
48
+ summary: "CGIKit is a componented-oriented web application framework like Apple Computers WebObjects. This framework services Model-View-Controller architecture programming by components based on a HTML file, a definition file and a Ruby source. "
49
+ require_paths:
50
+ - lib
51
+ email: info@spice-of-life.net
52
+ homepage: http://www.spice-of-life.net/download/cgikit/
53
+ rubyforge_project:
54
+ description:
55
+ autorequire: cgikit
56
+ default_executable:
57
+ bindir:
58
+ has_rdoc:
59
+ required_ruby_version:
60
+ platform:
61
+ signing_key:
62
+ cert_chain: []
63
+
64
+ authors:
65
+ files: []
66
+
67
+ test_files: []
68
+
69
+ rdoc_options: []
70
+
71
+ extra_rdoc_files: []
72
+
73
+ executables:
74
+ extensions:
75
+ requirements:
76
+ dependencies:
77
+
78
+ progressbar-0.0.3: !ruby/object:Gem::Specification
79
+ rubygems_version: 0.8.11
80
+ specification_version: -1
81
+ name: progressbar
82
+ version: !ruby/object:Gem::Version
83
+ version: 0.0.3
84
+ date: 2004-03-13 08:56:48.508436 -05:00
85
+ summary: Ruby/ProgressBar is a text progress bar library for Ruby. It can indicate progress with percentage, a progress bar, and estimated remaining time.
86
+ require_paths:
87
+ - lib
88
+ email: satoru@namazu.org
89
+ homepage: http://namazu.org/~satoru/ruby-progressbar/
90
+ rubyforge_project:
91
+ description:
92
+ autorequire: progressbar
93
+ default_executable:
94
+ bindir:
95
+ has_rdoc:
96
+ required_ruby_version:
97
+ platform:
98
+ signing_key:
99
+ cert_chain: []
100
+
101
+ authors:
102
+ files: []
103
+
104
+ test_files: []
105
+
106
+ rdoc_options: []
107
+
108
+ extra_rdoc_files: []
109
+
110
+ executables:
111
+ extensions:
112
+ requirements:
113
+ dependencies:
@@ -0,0 +1,3 @@
1
+ - Mark McGwire
2
+ - Sammy Sosa
3
+ - Ken Griffey
@@ -0,0 +1,8 @@
1
+ ---
2
+ hr:
3
+ - Mark McGwire
4
+ # Following node labeled SS
5
+ - &SS Sammy Sosa
6
+ rbi:
7
+ - *SS # Subsequent occurrence
8
+ - Ken Griffey
@@ -0,0 +1,8 @@
1
+ ---
2
+ # products purchased
3
+ - item : Super Hoop
4
+ quantity: 1
5
+ - item : Basketball
6
+ quantity: 4
7
+ - item : Big Shoes
8
+ quantity: 1
@@ -0,0 +1,4 @@
1
+ # ASCII Art
2
+ --- |
3
+ \//||\/||
4
+ // || ||__
@@ -0,0 +1,4 @@
1
+ ---
2
+ Mark McGwire's
3
+ year was crippled
4
+ by a knee injury.
@@ -0,0 +1,8 @@
1
+ >
2
+ Sammy Sosa completed another
3
+ fine season with great stats.
4
+
5
+ 63 Home Runs
6
+ 0.288 Batting Average
7
+
8
+ What a year!
@@ -0,0 +1,7 @@
1
+ name: Mark McGwire
2
+ accomplishment: >
3
+ Mark set a major league
4
+ home run record in 1998.
5
+ stats: |
6
+ 65 Home Runs
7
+ 0.278 Batting Average
@@ -0,0 +1,6 @@
1
+ plain:
2
+ This unquoted scalar
3
+ spans many lines.
4
+
5
+ quoted: "So does this
6
+ quoted scalar.\n"
@@ -0,0 +1,5 @@
1
+ canonical: 12345
2
+ decimal: +12,345
3
+ sexagecimal: 3:25:45
4
+ octal: 014
5
+ hexadecimal: 0xC
@@ -0,0 +1,3 @@
1
+ hr: 65
2
+ avg: 0.278
3
+ rbi: 147
@@ -0,0 +1,6 @@
1
+ canonical: 1.23015e+3
2
+ exponential: 12.3015e+02
3
+ sexagecimal: 20:30.15
4
+ fixed: 1,230.15
5
+ negative infinity: -.inf
6
+ not a number: .NaN
@@ -0,0 +1,4 @@
1
+ null: ~
2
+ true: y
3
+ false: n
4
+ string: '12345'
@@ -0,0 +1,4 @@
1
+ canonical: 2001-12-15T02:59:43.1Z
2
+ iso8601: 2001-12-14t21:59:43.10-05:00
3
+ spaced: 2001-12-14 21:59:43.10 -5
4
+ date: 2002-12-14
@@ -0,0 +1,13 @@
1
+ ---
2
+ not-date: !!str 2002-04-28
3
+
4
+ picture: !!binary |
5
+ R0lGODlhDAAMAIQAAP//9/X
6
+ 17unp5WZmZgAAAOfn515eXv
7
+ Pz7Y6OjuDg4J+fn5OTk6enp
8
+ 56enmleECcgggoBADs=
9
+
10
+ application specific tag: !something |
11
+ The semantics of the tag
12
+ above may be different for
13
+ different documents.
@@ -0,0 +1,14 @@
1
+ %TAG ! tag:clarkevans.com,2002:
2
+ --- !shape
3
+ # Use the ! handle for presenting
4
+ # tag:clarkevans.com,2002:circle
5
+ - !circle
6
+ center: &ORIGIN {x: 73, y: 129}
7
+ radius: 7
8
+ - !line
9
+ start: *ORIGIN
10
+ finish: { x: 89, y: 102 }
11
+ - !label
12
+ start: *ORIGIN
13
+ color: 0xFFEEBB
14
+ text: Pretty vector drawing.
@@ -0,0 +1,7 @@
1
+ # sets are represented as a
2
+ # mapping where each key is
3
+ # associated with the empty string
4
+ --- !!set
5
+ ? Mark McGwire
6
+ ? Sammy Sosa
7
+ ? Ken Griff
@@ -0,0 +1,7 @@
1
+ # ordered maps are represented as
2
+ # a sequence of mappings, with
3
+ # each mapping having one key
4
+ --- !!omap
5
+ - Mark McGwire: 65
6
+ - Sammy Sosa: 63
7
+ - Ken Griffy: 58
@@ -0,0 +1,29 @@
1
+ --- !<tag:clarkevans.com,2002:invoice>
2
+ invoice: 34843
3
+ date : 2001-01-23
4
+ bill-to: &id001
5
+ given : Chris
6
+ family : Dumars
7
+ address:
8
+ lines: |
9
+ 458 Walkman Dr.
10
+ Suite #292
11
+ city : Royal Oak
12
+ state : MI
13
+ postal : 48046
14
+ ship-to: *id001
15
+ product:
16
+ - sku : BL394D
17
+ quantity : 4
18
+ description : Basketball
19
+ price : 450.00
20
+ - sku : BL4438H
21
+ quantity : 1
22
+ description : Super Hoop
23
+ price : 2392.00
24
+ tax : 251.42
25
+ total: 4443.52
26
+ comments:
27
+ Late afternoon is best.
28
+ Backup contact is Nancy
29
+ Billsmer @ 338-4338.
@@ -0,0 +1,26 @@
1
+ ---
2
+ Time: 2001-11-23 15:01:42 -5
3
+ User: ed
4
+ Warning:
5
+ This is an error message
6
+ for the log file
7
+ ---
8
+ Time: 2001-11-23 15:02:31 -5
9
+ User: ed
10
+ Warning:
11
+ A slightly different error
12
+ message.
13
+ ---
14
+ Date: 2001-11-23 15:03:17 -5
15
+ User: ed
16
+ Fatal:
17
+ Unknown variable "bar"
18
+ Stack:
19
+ - file: TopClass.py
20
+ line: 23
21
+ code: |
22
+ x = MoreObject("345\n")
23
+ - file: MoreClass.py
24
+ line: 58
25
+ code: |-
26
+ foo = bar
@@ -0,0 +1,13 @@
1
+ %YAML 1.1
2
+ ---
3
+ !!map {
4
+ ? !!str "sequence"
5
+ : !!seq [
6
+ !!str "one", !!str "two"
7
+ ],
8
+ ? !!str "mapping"
9
+ : !!map {
10
+ ? !!str "sky" : !!str "blue",
11
+ ? !!str "sea" : !!str "green",
12
+ }
13
+ }
@@ -0,0 +1,8 @@
1
+ american:
2
+ - Boston Red Sox
3
+ - Detroit Tigers
4
+ - New York Yankees
5
+ national:
6
+ - New York Mets
7
+ - Chicago Cubs
8
+ - Atlanta Braves
@@ -0,0 +1,7 @@
1
+ sequence:
2
+ - one
3
+ - two
4
+ mapping:
5
+ ? sky
6
+ : blue
7
+ ? sea : green
@@ -0,0 +1,2 @@
1
+ sequence: [ one, two, ]
2
+ mapping: { sky: blue, sea: green }
@@ -0,0 +1,13 @@
1
+ %YAML 1.1
2
+ ---
3
+ !!map {
4
+ ? !!str "sequence"
5
+ : !!seq [
6
+ !!str "one", !!str "two"
7
+ ],
8
+ ? !!str "mapping"
9
+ : !!map {
10
+ ? !!str "sky" : !!str "blue",
11
+ ? !!str "sea" : !!str "green",
12
+ }
13
+ }
@@ -0,0 +1,2 @@
1
+ anchored: !local &anchor value
2
+ alias: *anchor
@@ -0,0 +1,8 @@
1
+ %YAML 1.1
2
+ ---
3
+ !!map {
4
+ ? !!str "anchored"
5
+ : !local &A1 "value",
6
+ ? !!str "alias"
7
+ : *A1,
8
+ }
@@ -0,0 +1,4 @@
1
+ literal: |
2
+ text
3
+ folded: >
4
+ text
@@ -0,0 +1,8 @@
1
+ %YAML 1.1
2
+ ---
3
+ !!map {
4
+ ? !!str "literal"
5
+ : !!str "text\n",
6
+ ? !!str "folded"
7
+ : !!str "text\n",
8
+ }
@@ -0,0 +1,2 @@
1
+ single: 'text'
2
+ double: "text"
@@ -0,0 +1,8 @@
1
+ %YAML 1.1
2
+ ---
3
+ !!map {
4
+ ? !!str "double"
5
+ : !!str "text",
6
+ ? !!str "single"
7
+ : !!str "text",
8
+ }
@@ -0,0 +1,2 @@
1
+ %YAML 1.1
2
+ --- text
@@ -0,0 +1,8 @@
1
+ -
2
+ name: Mark McGwire
3
+ hr: 65
4
+ avg: 0.278
5
+ -
6
+ name: Sammy Sosa
7
+ hr: 63
8
+ avg: 0.288
@@ -0,0 +1,3 @@
1
+ %YAML 1.1
2
+ ---
3
+ !!str "text"
@@ -0,0 +1,5 @@
1
+ "Fun with \\
2
+ \" \a \b \e \f
3
+ \n \r \t \v \0
4
+ \ \_ \N
5
+ \x41 "
@@ -0,0 +1,12 @@
1
+ # Leading comment line spaces are
2
+ # neither content nor indentation.
3
+
4
+ Not indented:
5
+ By one space: |
6
+ By four
7
+ spaces
8
+ Flow style: [ # Leading spaces
9
+ By two, # in flow style
10
+ Also by two, # are neither
11
+ ?Still by two # content nor
12
+ ] # indentation.