mkrf 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. data/CHANGELOG +2 -0
  2. data/MIT-LICENSE +7 -0
  3. data/README +54 -0
  4. data/Rakefile +107 -0
  5. data/lib/mkrf.rb +4 -0
  6. data/lib/mkrf/availability.rb +219 -0
  7. data/lib/mkrf/generator.rb +146 -0
  8. data/test/abstract_unit.rb +4 -0
  9. data/test/fixtures/down_a_directory/header_down_a_directory.h +1 -0
  10. data/test/fixtures/stdmkrf.h +1 -0
  11. data/test/sample_files/libtrivial/Rakefile +31 -0
  12. data/test/sample_files/libtrivial/extconf.rb +3 -0
  13. data/test/sample_files/libtrivial/lib/libtrivial.c +5 -0
  14. data/test/sample_files/libtrivial/lib/libtrivial.o +0 -0
  15. data/test/sample_files/libtrivial/libtrivial_so.bundle +0 -0
  16. data/test/sample_files/libtrivial/mkrf.log +1 -0
  17. data/test/sample_files/libxml-ruby-0.3.8/CHANGELOG +74 -0
  18. data/test/sample_files/libxml-ruby-0.3.8/LICENSE +22 -0
  19. data/test/sample_files/libxml-ruby-0.3.8/README +144 -0
  20. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/cbg.c +76 -0
  21. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/extconf.rb +49 -0
  22. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/libxml.c +86 -0
  23. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/libxml.h +82 -0
  24. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/libxml.rb +107 -0
  25. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/mkrf.log +1 -0
  26. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/old_extconf.rb +95 -0
  27. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_attr.c +372 -0
  28. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_attr.h +21 -0
  29. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_attribute.c +224 -0
  30. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_attribute.h +21 -0
  31. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_document.c +1159 -0
  32. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_document.h +27 -0
  33. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_dtd.c +168 -0
  34. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_dtd.h +17 -0
  35. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_input_cbg.c +167 -0
  36. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_input_cbg.h +21 -0
  37. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_node.c +2139 -0
  38. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_node.h +28 -0
  39. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_node_set.c +248 -0
  40. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_node_set.h +26 -0
  41. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_ns.c +153 -0
  42. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_ns.h +21 -0
  43. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_parser.c +1417 -0
  44. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_parser.h +31 -0
  45. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_parser_context.c +715 -0
  46. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_parser_context.h +22 -0
  47. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_sax_parser.c +426 -0
  48. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_sax_parser.h +52 -0
  49. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_schema.c +142 -0
  50. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_schema.h +16 -0
  51. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_tree.c +43 -0
  52. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_tree.h +12 -0
  53. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xinclude.c +20 -0
  54. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xinclude.h +13 -0
  55. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpath.c +363 -0
  56. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpath.h +24 -0
  57. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpath_context.c +125 -0
  58. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpath_context.h +24 -0
  59. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpointer.c +100 -0
  60. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpointer.h +27 -0
  61. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpointer_context.c +21 -0
  62. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpointer_context.h +18 -0
  63. data/test/sample_files/libxml-ruby-0.3.8/ext/xml/sax_parser_callbacks.inc +202 -0
  64. data/test/sample_files/syck-0.55/CHANGELOG +186 -0
  65. data/test/sample_files/syck-0.55/COPYING +54 -0
  66. data/test/sample_files/syck-0.55/Makefile +582 -0
  67. data/test/sample_files/syck-0.55/Makefile.am +5 -0
  68. data/test/sample_files/syck-0.55/Makefile.in +582 -0
  69. data/test/sample_files/syck-0.55/README +105 -0
  70. data/test/sample_files/syck-0.55/README.BYTECODE +484 -0
  71. data/test/sample_files/syck-0.55/README.EXT +444 -0
  72. data/test/sample_files/syck-0.55/RELEASE +123 -0
  73. data/test/sample_files/syck-0.55/TODO +25 -0
  74. data/test/sample_files/syck-0.55/aclocal.m4 +883 -0
  75. data/test/sample_files/syck-0.55/bootstrap +7 -0
  76. data/test/sample_files/syck-0.55/config.h +79 -0
  77. data/test/sample_files/syck-0.55/config.h.in +78 -0
  78. data/test/sample_files/syck-0.55/config.status +1197 -0
  79. data/test/sample_files/syck-0.55/config/README +14 -0
  80. data/test/sample_files/syck-0.55/config/depcomp +529 -0
  81. data/test/sample_files/syck-0.55/config/install-sh +323 -0
  82. data/test/sample_files/syck-0.55/config/missing +357 -0
  83. data/test/sample_files/syck-0.55/configure +6728 -0
  84. data/test/sample_files/syck-0.55/configure.in +36 -0
  85. data/test/sample_files/syck-0.55/ext/ruby/CHANGELOG +303 -0
  86. data/test/sample_files/syck-0.55/ext/ruby/README +400 -0
  87. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/MANIFEST +1 -0
  88. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/bytecode.c +1170 -0
  89. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/emitter.c +1224 -0
  90. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/extconf.rb +10 -0
  91. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/gram.c +1894 -0
  92. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/gram.h +79 -0
  93. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/handler.c +174 -0
  94. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/implicit.c +2989 -0
  95. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/mkrf.log +1 -0
  96. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/node.c +407 -0
  97. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/rubyext.c +2385 -0
  98. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/syck.c +504 -0
  99. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/syck.h +458 -0
  100. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/token.c +2707 -0
  101. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/yaml2byte.c +250 -0
  102. data/test/sample_files/syck-0.55/ext/ruby/ext/syck/yamlbyte.h +170 -0
  103. data/test/sample_files/syck-0.55/ext/ruby/install.rb +1022 -0
  104. data/test/sample_files/syck-0.55/ext/ruby/lib/okay.rb +161 -0
  105. data/test/sample_files/syck-0.55/ext/ruby/lib/okay/news.rb +69 -0
  106. data/test/sample_files/syck-0.55/ext/ruby/lib/okay/rpc.rb +434 -0
  107. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml.rb +436 -0
  108. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/baseemitter.rb +247 -0
  109. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/basenode.rb +216 -0
  110. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/compat.rb +26 -0
  111. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/constants.rb +45 -0
  112. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/dbm.rb +111 -0
  113. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/emitter.rb +107 -0
  114. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/encoding.rb +33 -0
  115. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/error.rb +34 -0
  116. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/rubytypes.rb +438 -0
  117. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/store.rb +29 -0
  118. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/stream.rb +40 -0
  119. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/stringio.rb +83 -0
  120. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/syck.rb +19 -0
  121. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/tag.rb +86 -0
  122. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/types.rb +188 -0
  123. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/yamlnode.rb +54 -0
  124. data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/ypath.rb +52 -0
  125. data/test/sample_files/syck-0.55/ext/ruby/lib/yod.rb +1168 -0
  126. data/test/sample_files/syck-0.55/ext/ruby/samples/okayNews-modules.rb +27 -0
  127. data/test/sample_files/syck-0.55/ext/ruby/samples/okayNews-sample.rb +336 -0
  128. data/test/sample_files/syck-0.55/ext/ruby/samples/okayNews-validate.rb +341 -0
  129. data/test/sample_files/syck-0.55/ext/ruby/samples/okayRpc-client.rb +51 -0
  130. data/test/sample_files/syck-0.55/ext/ruby/samples/okayRpc-server.rb +85 -0
  131. data/test/sample_files/syck-0.55/ext/ruby/samples/yaml-sortHashKeys.rb +128 -0
  132. data/test/sample_files/syck-0.55/ext/ruby/tests/basic.rb +1653 -0
  133. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsAnchorAlias.yml +51 -0
  134. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsBasicTests.yml +282 -0
  135. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsBlockMapping.yml +78 -0
  136. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsBlockSequence.yml +0 -0
  137. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsDocumentSeparator.yml +102 -0
  138. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsErrorTests.yml +23 -0
  139. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsFlowCollections.yml +73 -0
  140. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsFoldedScalars.yml +215 -0
  141. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsMapInSeq.yml +0 -0
  142. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsNullsAndEmpties.yml +66 -0
  143. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsRubyTests.yml +182 -0
  144. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsSpecificationExamples.yml +2699 -0
  145. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsTypeTransfers.yml +265 -0
  146. data/test/sample_files/syck-0.55/ext/ruby/yts/YtsYpath.yml +221 -0
  147. data/test/sample_files/syck-0.55/ext/ruby/yts/cookbook.rb +159 -0
  148. data/test/sample_files/syck-0.55/ext/ruby/yts/index.yml +10 -0
  149. data/test/sample_files/syck-0.55/ext/ruby/yts/yts.rb +193 -0
  150. data/test/sample_files/syck-0.55/lib/Makefile +497 -0
  151. data/test/sample_files/syck-0.55/lib/Makefile.am +27 -0
  152. data/test/sample_files/syck-0.55/lib/Makefile.in +497 -0
  153. data/test/sample_files/syck-0.55/lib/bytecode.c +1170 -0
  154. data/test/sample_files/syck-0.55/lib/bytecode.re +525 -0
  155. data/test/sample_files/syck-0.55/lib/emitter.c +1224 -0
  156. data/test/sample_files/syck-0.55/lib/gram.c +1894 -0
  157. data/test/sample_files/syck-0.55/lib/gram.h +79 -0
  158. data/test/sample_files/syck-0.55/lib/gram.output +2005 -0
  159. data/test/sample_files/syck-0.55/lib/gram.y +481 -0
  160. data/test/sample_files/syck-0.55/lib/handler.c +174 -0
  161. data/test/sample_files/syck-0.55/lib/implicit.c +2989 -0
  162. data/test/sample_files/syck-0.55/lib/implicit.re +206 -0
  163. data/test/sample_files/syck-0.55/lib/node.c +407 -0
  164. data/test/sample_files/syck-0.55/lib/syck.c +504 -0
  165. data/test/sample_files/syck-0.55/lib/syck.h +458 -0
  166. data/test/sample_files/syck-0.55/lib/syck_st.c +577 -0
  167. data/test/sample_files/syck-0.55/lib/syck_st.h +46 -0
  168. data/test/sample_files/syck-0.55/lib/token.c +2707 -0
  169. data/test/sample_files/syck-0.55/lib/token.re +1139 -0
  170. data/test/sample_files/syck-0.55/lib/yaml2byte.c +250 -0
  171. data/test/sample_files/syck-0.55/lib/yamlbyte.h +170 -0
  172. data/test/sample_files/syck-0.55/stamp-h1 +1 -0
  173. data/test/sample_files/syck-0.55/tests/Basic.c +141 -0
  174. data/test/sample_files/syck-0.55/tests/CuTest.c +294 -0
  175. data/test/sample_files/syck-0.55/tests/CuTest.h +84 -0
  176. data/test/sample_files/syck-0.55/tests/Emit.c +87 -0
  177. data/test/sample_files/syck-0.55/tests/Makefile +480 -0
  178. data/test/sample_files/syck-0.55/tests/Makefile.am +13 -0
  179. data/test/sample_files/syck-0.55/tests/Makefile.in +480 -0
  180. data/test/sample_files/syck-0.55/tests/Parse.c +208 -0
  181. data/test/sample_files/syck-0.55/tests/YTS.c +2310 -0
  182. data/test/sample_files/syck-0.55/tests/YTS.c.erb +326 -0
  183. data/test/sample_files/syck-0.55/tests/YTS.c.rb +44 -0
  184. data/test/test_availability.rb +68 -0
  185. data/test/test_generator.rb +74 -0
  186. metadata +252 -0
@@ -0,0 +1,265 @@
1
+ --- %YAML:1.0
2
+ test: Strings
3
+ brief: >
4
+ Any group of characters beginning with an
5
+ alphabetic or numeric character is a string,
6
+ unless it belongs to one of the groups below
7
+ (such as an Integer or Time).
8
+ yaml: |
9
+ --- String
10
+ ruby: |
11
+ 'String'
12
+
13
+ ---
14
+ test: String characters
15
+ brief: >
16
+ A string can contain any alphabetic or
17
+ numeric character, along with many
18
+ punctuation characters, including the
19
+ period, dash, space, quotes, exclamation, and
20
+ question mark.
21
+ yaml: |
22
+ - What's Yaml?
23
+ - It's for writing data structures in plain text.
24
+ - And?
25
+ - And what? That's not good enough for you?
26
+ - No, I mean, "And what about Yaml?"
27
+ - Oh, oh yeah. Uh.. Yaml for Ruby.
28
+ ruby: |
29
+ [
30
+ "What's Yaml?",
31
+ "It's for writing data structures in plain text.",
32
+ "And?",
33
+ "And what? That's not good enough for you?",
34
+ "No, I mean, \"And what about Yaml?\"",
35
+ "Oh, oh yeah. Uh.. Yaml for Ruby."
36
+ ]
37
+
38
+ ---
39
+ test: Indicators in Strings
40
+ brief: >
41
+ Be careful using indicators in strings. In particular,
42
+ the comma, colon, and pound sign must be used carefully.
43
+ yaml: |
44
+ the colon followed by space is an indicator: but is a string:right here
45
+ same for the pound sign: here we have it#in a string
46
+ the comma can, honestly, be used in most cases: [ but not in, inline collections ]
47
+ ruby: |
48
+ {
49
+ 'the colon followed by space is an indicator' => 'but is a string:right here',
50
+ 'same for the pound sign' => 'here we have it#in a string',
51
+ 'the comma can, honestly, be used in most cases' => [ 'but not in', 'inline collections' ]
52
+ }
53
+
54
+ ---
55
+ test: Forcing Strings
56
+ brief: >
57
+ Any YAML type can be forced into a string using the
58
+ explicit !str method.
59
+ yaml: |
60
+ date string: !str 2001-08-01
61
+ number string: !str 192
62
+ ruby: |
63
+ {
64
+ 'date string' => '2001-08-01',
65
+ 'number string' => '192'
66
+ }
67
+
68
+ ---
69
+ test: Single-quoted Strings
70
+ brief: >
71
+ You can also enclose your strings within single quotes,
72
+ which allows use of slashes, colons, and other indicators
73
+ freely. Inside single quotes, you can represent a single
74
+ quote in your string by using two single quotes next to
75
+ each other.
76
+ yaml: |
77
+ all my favorite symbols: '#:!/%.)'
78
+ a few i hate: '&(*'
79
+ why do i hate them?: 'it''s very hard to explain'
80
+ ruby: |
81
+ {
82
+ 'all my favorite symbols' => '#:!/%.)',
83
+ 'a few i hate' => '&(*',
84
+ 'why do i hate them?' => 'it\'s very hard to explain'
85
+ }
86
+
87
+ ---
88
+ test: Double-quoted Strings
89
+ brief: >
90
+ Enclosing strings in double quotes allows you
91
+ to use escapings to represent ASCII and
92
+ Unicode characters.
93
+ yaml: |
94
+ i know where i want my line breaks: "one here\nand another here\n"
95
+ ruby: |
96
+ {
97
+ 'i know where i want my line breaks' => "one here\nand another here\n"
98
+ }
99
+
100
+ ---
101
+ test: Multi-line Quoted Strings
102
+ brief: >
103
+ Both single- and double-quoted strings may be
104
+ carried on to new lines in your YAML document.
105
+ They must be indented a step and indentation
106
+ is interpreted as a single space.
107
+ yaml: |
108
+ i want a long string: "so i'm going to
109
+ let it go on and on to other lines
110
+ until i end it with a quote."
111
+ ruby: |
112
+ { 'i want a long string' => "so i'm going to " +
113
+ "let it go on and on to other lines " +
114
+ "until i end it with a quote."
115
+ }
116
+
117
+ ---
118
+ test: Plain scalars
119
+ brief: >
120
+ Unquoted strings may also span multiple lines, if they
121
+ are free of YAML space indicators and indented.
122
+ yaml: |
123
+ - My little toe is broken in two places;
124
+ - I'm crazy to have skied this way;
125
+ - I'm not the craziest he's seen, since there was always the German guy
126
+ who skied for 3 hours on a broken shin bone (just below the kneecap);
127
+ - Nevertheless, second place is respectable, and he doesn't
128
+ recommend going for the record;
129
+ - He's going to put my foot in plaster for a month;
130
+ - This would impair my skiing ability somewhat for the
131
+ duration, as can be imagined.
132
+ ruby: |
133
+ [
134
+ "My little toe is broken in two places;",
135
+ "I'm crazy to have skied this way;",
136
+ "I'm not the craziest he's seen, since there was always " +
137
+ "the German guy who skied for 3 hours on a broken shin " +
138
+ "bone (just below the kneecap);",
139
+ "Nevertheless, second place is respectable, and he doesn't " +
140
+ "recommend going for the record;",
141
+ "He's going to put my foot in plaster for a month;",
142
+ "This would impair my skiing ability somewhat for the duration, " +
143
+ "as can be imagined."
144
+ ]
145
+
146
+ ---
147
+ test: 'Null'
148
+ brief: >
149
+ You can use the tilde '~' character for a null value.
150
+ yaml: |
151
+ name: Mr. Show
152
+ hosted by: Bob and David
153
+ date of next season: ~
154
+ ruby: |
155
+ {
156
+ 'name' => 'Mr. Show',
157
+ 'hosted by' => 'Bob and David',
158
+ 'date of next season' => nil
159
+ }
160
+
161
+ ---
162
+ test: Boolean
163
+ brief: >
164
+ You can use 'true' and 'false' for boolean values.
165
+ yaml: |
166
+ Is Gus a Liar?: true
167
+ Do I rely on Gus for Sustenance?: false
168
+ ruby: |
169
+ {
170
+ 'Is Gus a Liar?' => true,
171
+ 'Do I rely on Gus for Sustenance?' => false
172
+ }
173
+
174
+ ---
175
+ test: Integers
176
+ brief: >
177
+ An integer is a series of numbers, optionally
178
+ starting with a positive or negative sign. Integers
179
+ may also contain commas for readability.
180
+ yaml: |
181
+ zero: 0
182
+ simple: 12
183
+ one-thousand: 1,000
184
+ negative one-thousand: -1,000
185
+ ruby: |
186
+ {
187
+ 'zero' => 0,
188
+ 'simple' => 12,
189
+ 'one-thousand' => 1000,
190
+ 'negative one-thousand' => -1000
191
+ }
192
+ python: |
193
+ [
194
+ {
195
+ 'zero': 0,
196
+ 'simple': 12,
197
+ 'one-thousand': 1000,
198
+ 'negative one-thousand': -1000,
199
+ }
200
+ ]
201
+ ---
202
+ test: Integers as Map Keys
203
+ brief: >
204
+ An integer can be used a dictionary key.
205
+ yaml: |
206
+ 1: one
207
+ 2: two
208
+ 3: three
209
+ python: |
210
+ [
211
+ {
212
+ 1: 'one',
213
+ 2: 'two',
214
+ 3: 'three',
215
+ }
216
+ ]
217
+ ruby: |
218
+ {
219
+ 1 => 'one',
220
+ 2 => 'two',
221
+ 3 => 'three'
222
+ }
223
+
224
+ ---
225
+ test: Floats
226
+ brief: >
227
+ Floats are represented by numbers with decimals,
228
+ allowing for scientific notation, as well as
229
+ positive and negative infinity and "not a number."
230
+ yaml: |
231
+ a simple float: 2.00
232
+ larger float: 1,000.09
233
+ scientific notation: 1.00009e+3
234
+ ruby: |
235
+ {
236
+ 'a simple float' => 2.0,
237
+ 'larger float' => 1000.09,
238
+ 'scientific notation' => 1000.09
239
+ }
240
+
241
+ ---
242
+ test: Time
243
+ brief: >
244
+ You can represent timestamps by using
245
+ ISO8601 format, or a variation which
246
+ allows spaces between the date, time and
247
+ time zone.
248
+ yaml: |
249
+ iso8601: 2001-12-14t21:59:43.10-05:00
250
+ space seperated: 2001-12-14 21:59:43.10 -05:00
251
+ ruby: |
252
+ {
253
+ 'iso8601' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ),
254
+ 'space seperated' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" )
255
+ }
256
+
257
+ ---
258
+ test: Date
259
+ brief: >
260
+ A date can be represented by its year,
261
+ month and day in ISO8601 order.
262
+ yaml: |
263
+ --- 1976-07-31
264
+ ruby: |
265
+ Date.new( 1976, 7, 31 )
@@ -0,0 +1,221 @@
1
+ data:
2
+ apple: red
3
+ ypath: /
4
+ expected:
5
+ - /
6
+ ---
7
+ data:
8
+ apple: red
9
+ ypath: .
10
+ expected:
11
+ - /
12
+ ---
13
+ data:
14
+ apple: red
15
+ ypath: /*
16
+ expected:
17
+ - /apple
18
+ ---
19
+ data:
20
+ apple: red
21
+ lemon: yellow
22
+ ypath: /*
23
+ expected:
24
+ - /apple
25
+ - /lemon
26
+ unordered: 1
27
+ ---
28
+ data:
29
+ fruit:
30
+ banana: yellow
31
+ vegetable:
32
+ carrot: orange
33
+ ypath: //.
34
+ expected:
35
+ - /
36
+ - /fruit
37
+ - /fruit/banana
38
+ - /vegetable
39
+ - /vegetable/carrot
40
+ unordered: 1
41
+ ---
42
+ data:
43
+ one:
44
+ two: xxx
45
+ ypath: //two/..
46
+ expected:
47
+ - /one
48
+ ---
49
+ data:
50
+ apple: red
51
+ ypath: /apple
52
+ expected:
53
+ - /apple
54
+ ---
55
+ data:
56
+ apple: red
57
+ lemon: yellow
58
+ ypath: /"lemon"
59
+ expected:
60
+ - /lemon
61
+ ---
62
+ data:
63
+ apple: red
64
+ lemon: yellow
65
+ ypath: /'lemon'
66
+ expected:
67
+ - /lemon
68
+ ---
69
+ data:
70
+ apple: red
71
+ lemon: yellow
72
+ ypath: /lemon
73
+ expected:
74
+ - /lemon
75
+ ---
76
+ data:
77
+ - apple
78
+ - lemon
79
+ ypath: /0
80
+ expected:
81
+ - /0
82
+ ---
83
+ data:
84
+ apple: red
85
+ lemon: yellow
86
+ ypath: /orange
87
+ expected: []
88
+ ---
89
+ data:
90
+ apple: red
91
+ ypath: ./.
92
+ expected:
93
+ - /
94
+ ---
95
+ data:
96
+ fruit:
97
+ banana: yellow
98
+ vegetable:
99
+ carrot: orange
100
+ ypath: /fruit/banana
101
+ expected:
102
+ - /fruit/banana
103
+ ---
104
+ data:
105
+ fruit:
106
+ banana: yellow
107
+ vegetable:
108
+ carrot: orange
109
+ ypath: fruit/banana
110
+ expected:
111
+ - /fruit/banana
112
+ ---
113
+ data:
114
+ names:
115
+ - Steve Howell
116
+ - Clark Evans
117
+ ypath: /names/0
118
+ expected:
119
+ - /names/0
120
+ ---
121
+ data:
122
+ names:
123
+ - first: Clark
124
+ last: Evans
125
+ - first: Steve
126
+ last: Howell
127
+ ypath: /names/1/first
128
+ expected:
129
+ - /names/1/first
130
+ ---
131
+ data:
132
+ names:
133
+ - first: Clark
134
+ last: Evans
135
+ - first: Steve
136
+ last: Howell
137
+ ypath: /names/*/first
138
+ expected:
139
+ - /names/0/first
140
+ - /names/1/first
141
+ ---
142
+ data:
143
+ names:
144
+ python-heads:
145
+ - first: Clark
146
+ last: Evans
147
+ - first: Steve
148
+ last: Howell
149
+ perl-heads:
150
+ - first: Brian
151
+ last: Ingerson
152
+ ypath: names//first
153
+ expected:
154
+ - /names/python-heads/0/first
155
+ - /names/python-heads/1/first
156
+ - /names/perl-heads/0/first
157
+ ---
158
+ data:
159
+ task:
160
+ - name: wake
161
+ foo: bar
162
+ - name: eat
163
+ task:
164
+ - name: veggies
165
+ - name: meats
166
+ - name: sleep
167
+ ypath: //task
168
+ expected:
169
+ - /task
170
+ - /task/1/task
171
+ ---
172
+ data:
173
+ - one:
174
+ name: xxx
175
+ - two:
176
+ name: yyy
177
+ - three:
178
+ name: zzz
179
+ ypath: /*/one/name|//three/name
180
+ expected:
181
+ - /0/one/name
182
+ - /2/three/name
183
+ ---
184
+ data:
185
+ apple: red
186
+ ypath: .|/apple|apple|/|.
187
+ expected:
188
+ - /
189
+ - /apple
190
+ ---
191
+ data:
192
+ - one:
193
+ name: xxx
194
+ - two:
195
+ name: yyy
196
+ - three:
197
+ name: zzz
198
+ ypath: /*/(one|three)/name
199
+ expected:
200
+ - /0/one/name
201
+ - /2/three/name
202
+ ---
203
+ data:
204
+ - one: xxx
205
+ - two: yyy
206
+ - one: zzz
207
+ ypath: /*[one]
208
+ expected:
209
+ - /0
210
+ - /2
211
+ ---
212
+ data:
213
+ - food: Hamburger
214
+ calories: 900
215
+ - food: Fries
216
+ calories: 650
217
+ - food: Soft Drink
218
+ calories: 350
219
+ ypath: //food[.=Fries]
220
+ expected:
221
+ - /1/food