mkrf 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/MIT-LICENSE +7 -0
- data/README +54 -0
- data/Rakefile +107 -0
- data/lib/mkrf.rb +4 -0
- data/lib/mkrf/availability.rb +219 -0
- data/lib/mkrf/generator.rb +146 -0
- data/test/abstract_unit.rb +4 -0
- data/test/fixtures/down_a_directory/header_down_a_directory.h +1 -0
- data/test/fixtures/stdmkrf.h +1 -0
- data/test/sample_files/libtrivial/Rakefile +31 -0
- data/test/sample_files/libtrivial/extconf.rb +3 -0
- data/test/sample_files/libtrivial/lib/libtrivial.c +5 -0
- data/test/sample_files/libtrivial/lib/libtrivial.o +0 -0
- data/test/sample_files/libtrivial/libtrivial_so.bundle +0 -0
- data/test/sample_files/libtrivial/mkrf.log +1 -0
- data/test/sample_files/libxml-ruby-0.3.8/CHANGELOG +74 -0
- data/test/sample_files/libxml-ruby-0.3.8/LICENSE +22 -0
- data/test/sample_files/libxml-ruby-0.3.8/README +144 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/cbg.c +76 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/extconf.rb +49 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/libxml.c +86 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/libxml.h +82 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/libxml.rb +107 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/mkrf.log +1 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/old_extconf.rb +95 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_attr.c +372 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_attr.h +21 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_attribute.c +224 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_attribute.h +21 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_document.c +1159 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_document.h +27 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_dtd.c +168 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_dtd.h +17 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_input_cbg.c +167 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_input_cbg.h +21 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_node.c +2139 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_node.h +28 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_node_set.c +248 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_node_set.h +26 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_ns.c +153 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_ns.h +21 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_parser.c +1417 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_parser.h +31 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_parser_context.c +715 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_parser_context.h +22 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_sax_parser.c +426 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_sax_parser.h +52 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_schema.c +142 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_schema.h +16 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_tree.c +43 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_tree.h +12 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xinclude.c +20 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xinclude.h +13 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpath.c +363 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpath.h +24 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpath_context.c +125 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpath_context.h +24 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpointer.c +100 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpointer.h +27 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpointer_context.c +21 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/ruby_xml_xpointer_context.h +18 -0
- data/test/sample_files/libxml-ruby-0.3.8/ext/xml/sax_parser_callbacks.inc +202 -0
- data/test/sample_files/syck-0.55/CHANGELOG +186 -0
- data/test/sample_files/syck-0.55/COPYING +54 -0
- data/test/sample_files/syck-0.55/Makefile +582 -0
- data/test/sample_files/syck-0.55/Makefile.am +5 -0
- data/test/sample_files/syck-0.55/Makefile.in +582 -0
- data/test/sample_files/syck-0.55/README +105 -0
- data/test/sample_files/syck-0.55/README.BYTECODE +484 -0
- data/test/sample_files/syck-0.55/README.EXT +444 -0
- data/test/sample_files/syck-0.55/RELEASE +123 -0
- data/test/sample_files/syck-0.55/TODO +25 -0
- data/test/sample_files/syck-0.55/aclocal.m4 +883 -0
- data/test/sample_files/syck-0.55/bootstrap +7 -0
- data/test/sample_files/syck-0.55/config.h +79 -0
- data/test/sample_files/syck-0.55/config.h.in +78 -0
- data/test/sample_files/syck-0.55/config.status +1197 -0
- data/test/sample_files/syck-0.55/config/README +14 -0
- data/test/sample_files/syck-0.55/config/depcomp +529 -0
- data/test/sample_files/syck-0.55/config/install-sh +323 -0
- data/test/sample_files/syck-0.55/config/missing +357 -0
- data/test/sample_files/syck-0.55/configure +6728 -0
- data/test/sample_files/syck-0.55/configure.in +36 -0
- data/test/sample_files/syck-0.55/ext/ruby/CHANGELOG +303 -0
- data/test/sample_files/syck-0.55/ext/ruby/README +400 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/MANIFEST +1 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/bytecode.c +1170 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/emitter.c +1224 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/extconf.rb +10 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/gram.c +1894 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/gram.h +79 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/handler.c +174 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/implicit.c +2989 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/mkrf.log +1 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/node.c +407 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/rubyext.c +2385 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/syck.c +504 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/syck.h +458 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/token.c +2707 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/yaml2byte.c +250 -0
- data/test/sample_files/syck-0.55/ext/ruby/ext/syck/yamlbyte.h +170 -0
- data/test/sample_files/syck-0.55/ext/ruby/install.rb +1022 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/okay.rb +161 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/okay/news.rb +69 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/okay/rpc.rb +434 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml.rb +436 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/baseemitter.rb +247 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/basenode.rb +216 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/compat.rb +26 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/constants.rb +45 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/dbm.rb +111 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/emitter.rb +107 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/encoding.rb +33 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/error.rb +34 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/rubytypes.rb +438 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/store.rb +29 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/stream.rb +40 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/stringio.rb +83 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/syck.rb +19 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/tag.rb +86 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/types.rb +188 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/yamlnode.rb +54 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yaml/ypath.rb +52 -0
- data/test/sample_files/syck-0.55/ext/ruby/lib/yod.rb +1168 -0
- data/test/sample_files/syck-0.55/ext/ruby/samples/okayNews-modules.rb +27 -0
- data/test/sample_files/syck-0.55/ext/ruby/samples/okayNews-sample.rb +336 -0
- data/test/sample_files/syck-0.55/ext/ruby/samples/okayNews-validate.rb +341 -0
- data/test/sample_files/syck-0.55/ext/ruby/samples/okayRpc-client.rb +51 -0
- data/test/sample_files/syck-0.55/ext/ruby/samples/okayRpc-server.rb +85 -0
- data/test/sample_files/syck-0.55/ext/ruby/samples/yaml-sortHashKeys.rb +128 -0
- data/test/sample_files/syck-0.55/ext/ruby/tests/basic.rb +1653 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsAnchorAlias.yml +51 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsBasicTests.yml +282 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsBlockMapping.yml +78 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsBlockSequence.yml +0 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsDocumentSeparator.yml +102 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsErrorTests.yml +23 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsFlowCollections.yml +73 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsFoldedScalars.yml +215 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsMapInSeq.yml +0 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsNullsAndEmpties.yml +66 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsRubyTests.yml +182 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsSpecificationExamples.yml +2699 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsTypeTransfers.yml +265 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/YtsYpath.yml +221 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/cookbook.rb +159 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/index.yml +10 -0
- data/test/sample_files/syck-0.55/ext/ruby/yts/yts.rb +193 -0
- data/test/sample_files/syck-0.55/lib/Makefile +497 -0
- data/test/sample_files/syck-0.55/lib/Makefile.am +27 -0
- data/test/sample_files/syck-0.55/lib/Makefile.in +497 -0
- data/test/sample_files/syck-0.55/lib/bytecode.c +1170 -0
- data/test/sample_files/syck-0.55/lib/bytecode.re +525 -0
- data/test/sample_files/syck-0.55/lib/emitter.c +1224 -0
- data/test/sample_files/syck-0.55/lib/gram.c +1894 -0
- data/test/sample_files/syck-0.55/lib/gram.h +79 -0
- data/test/sample_files/syck-0.55/lib/gram.output +2005 -0
- data/test/sample_files/syck-0.55/lib/gram.y +481 -0
- data/test/sample_files/syck-0.55/lib/handler.c +174 -0
- data/test/sample_files/syck-0.55/lib/implicit.c +2989 -0
- data/test/sample_files/syck-0.55/lib/implicit.re +206 -0
- data/test/sample_files/syck-0.55/lib/node.c +407 -0
- data/test/sample_files/syck-0.55/lib/syck.c +504 -0
- data/test/sample_files/syck-0.55/lib/syck.h +458 -0
- data/test/sample_files/syck-0.55/lib/syck_st.c +577 -0
- data/test/sample_files/syck-0.55/lib/syck_st.h +46 -0
- data/test/sample_files/syck-0.55/lib/token.c +2707 -0
- data/test/sample_files/syck-0.55/lib/token.re +1139 -0
- data/test/sample_files/syck-0.55/lib/yaml2byte.c +250 -0
- data/test/sample_files/syck-0.55/lib/yamlbyte.h +170 -0
- data/test/sample_files/syck-0.55/stamp-h1 +1 -0
- data/test/sample_files/syck-0.55/tests/Basic.c +141 -0
- data/test/sample_files/syck-0.55/tests/CuTest.c +294 -0
- data/test/sample_files/syck-0.55/tests/CuTest.h +84 -0
- data/test/sample_files/syck-0.55/tests/Emit.c +87 -0
- data/test/sample_files/syck-0.55/tests/Makefile +480 -0
- data/test/sample_files/syck-0.55/tests/Makefile.am +13 -0
- data/test/sample_files/syck-0.55/tests/Makefile.in +480 -0
- data/test/sample_files/syck-0.55/tests/Parse.c +208 -0
- data/test/sample_files/syck-0.55/tests/YTS.c +2310 -0
- data/test/sample_files/syck-0.55/tests/YTS.c.erb +326 -0
- data/test/sample_files/syck-0.55/tests/YTS.c.rb +44 -0
- data/test/test_availability.rb +68 -0
- data/test/test_generator.rb +74 -0
- metadata +252 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
--- %YAML:1.0
|
2
|
+
test: Simple Alias Example
|
3
|
+
brief: >
|
4
|
+
If you need to refer to the same item of data twice,
|
5
|
+
you can give that item an alias. The alias is a plain
|
6
|
+
string, starting with an ampersand. The item may then
|
7
|
+
be referred to by the alias throughout your document
|
8
|
+
by using an asterisk before the name of the alias.
|
9
|
+
This is called an anchor.
|
10
|
+
yaml: |
|
11
|
+
- &showell Steve
|
12
|
+
- Clark
|
13
|
+
- Brian
|
14
|
+
- Oren
|
15
|
+
- *showell
|
16
|
+
python: |
|
17
|
+
[
|
18
|
+
[ 'Steve', 'Clark', 'Brian', 'Oren', 'Steve']
|
19
|
+
]
|
20
|
+
ruby-setup: |
|
21
|
+
showell = 'Steve'
|
22
|
+
ruby: |
|
23
|
+
[ showell, 'Clark', 'Brian', 'Oren', showell ]
|
24
|
+
|
25
|
+
---
|
26
|
+
test: Alias of a Mapping
|
27
|
+
brief: >
|
28
|
+
An alias can be used on any item of data, including
|
29
|
+
sequences, mappings, and other complex data types.
|
30
|
+
yaml: |
|
31
|
+
- &hello
|
32
|
+
Meat: pork
|
33
|
+
Starch: potato
|
34
|
+
- banana
|
35
|
+
- *hello
|
36
|
+
python: |
|
37
|
+
[
|
38
|
+
[
|
39
|
+
{'Meat': 'pork', 'Starch': 'potato'},
|
40
|
+
'banana',
|
41
|
+
{'Meat': 'pork', 'Starch': 'potato'},
|
42
|
+
]
|
43
|
+
]
|
44
|
+
ruby-setup: |
|
45
|
+
hello = { 'Meat' => 'pork', 'Starch' => 'potato' }
|
46
|
+
ruby: |
|
47
|
+
[
|
48
|
+
hello,
|
49
|
+
'banana',
|
50
|
+
hello
|
51
|
+
]
|
@@ -0,0 +1,282 @@
|
|
1
|
+
--- %YAML:1.0
|
2
|
+
test: Simple Sequence
|
3
|
+
brief: |
|
4
|
+
You can specify a list in YAML by placing each
|
5
|
+
member of the list on a new line with an opening
|
6
|
+
dash. These lists are called sequences.
|
7
|
+
yaml: |
|
8
|
+
- apple
|
9
|
+
- banana
|
10
|
+
- carrot
|
11
|
+
perl: |
|
12
|
+
['apple', 'banana', 'carrot']
|
13
|
+
python: |
|
14
|
+
[
|
15
|
+
['apple', 'banana', 'carrot']
|
16
|
+
]
|
17
|
+
ruby: |
|
18
|
+
['apple', 'banana', 'carrot']
|
19
|
+
|
20
|
+
---
|
21
|
+
test: Nested Sequences
|
22
|
+
brief: |
|
23
|
+
You can include a sequence within another
|
24
|
+
sequence by giving the sequence an empty
|
25
|
+
dash, followed by an indented list.
|
26
|
+
yaml: |
|
27
|
+
-
|
28
|
+
- foo
|
29
|
+
- bar
|
30
|
+
- baz
|
31
|
+
perl: |
|
32
|
+
[['foo', 'bar', 'baz']]
|
33
|
+
python: |
|
34
|
+
[
|
35
|
+
[['foo', 'bar', 'baz']]
|
36
|
+
]
|
37
|
+
ruby: |
|
38
|
+
[['foo', 'bar', 'baz']]
|
39
|
+
|
40
|
+
---
|
41
|
+
test: Mixed Sequences
|
42
|
+
brief: |
|
43
|
+
Sequences can contain any YAML data,
|
44
|
+
including strings and other sequences.
|
45
|
+
yaml: |
|
46
|
+
- apple
|
47
|
+
-
|
48
|
+
- foo
|
49
|
+
- bar
|
50
|
+
- x123
|
51
|
+
- banana
|
52
|
+
- carrot
|
53
|
+
perl: |
|
54
|
+
['apple', ['foo', 'bar', 'x123'], 'banana', 'carrot']
|
55
|
+
python: |
|
56
|
+
[
|
57
|
+
['apple', ['foo', 'bar', 'x123'], 'banana', 'carrot']
|
58
|
+
]
|
59
|
+
ruby: |
|
60
|
+
['apple', ['foo', 'bar', 'x123'], 'banana', 'carrot']
|
61
|
+
|
62
|
+
---
|
63
|
+
test: Deeply Nested Sequences
|
64
|
+
brief: |
|
65
|
+
Sequences can be nested even deeper, with each
|
66
|
+
level of indentation representing a level of
|
67
|
+
depth.
|
68
|
+
yaml: |
|
69
|
+
-
|
70
|
+
-
|
71
|
+
- uno
|
72
|
+
- dos
|
73
|
+
perl: |
|
74
|
+
[[['uno', 'dos']]]
|
75
|
+
python: |
|
76
|
+
[
|
77
|
+
[[['uno', 'dos']]]
|
78
|
+
]
|
79
|
+
ruby: |
|
80
|
+
[[['uno', 'dos']]]
|
81
|
+
|
82
|
+
---
|
83
|
+
test: Simple Mapping
|
84
|
+
brief: |
|
85
|
+
You can add a keyed list (also known as a dictionary or
|
86
|
+
hash) to your document by placing each member of the
|
87
|
+
list on a new line, with a colon seperating the key
|
88
|
+
from its value. In YAML, this type of list is called
|
89
|
+
a mapping.
|
90
|
+
yaml: |
|
91
|
+
foo: whatever
|
92
|
+
bar: stuff
|
93
|
+
perl: |
|
94
|
+
{ foo => 'whatever', bar => 'stuff' }
|
95
|
+
python: |
|
96
|
+
[
|
97
|
+
{'foo': 'whatever', 'bar': 'stuff'}
|
98
|
+
]
|
99
|
+
ruby: |
|
100
|
+
{ 'foo' => 'whatever', 'bar' => 'stuff' }
|
101
|
+
|
102
|
+
---
|
103
|
+
test: Sequence in a Mapping
|
104
|
+
brief: |
|
105
|
+
A value in a mapping can be a sequence.
|
106
|
+
yaml: |
|
107
|
+
foo: whatever
|
108
|
+
bar:
|
109
|
+
- uno
|
110
|
+
- dos
|
111
|
+
perl: |
|
112
|
+
{ foo => 'whatever', bar => [ 'uno', 'dos' ] }
|
113
|
+
python: |
|
114
|
+
[
|
115
|
+
{'foo': 'whatever', 'bar': ['uno', 'dos']}
|
116
|
+
]
|
117
|
+
ruby: |
|
118
|
+
{ 'foo' => 'whatever', 'bar' => [ 'uno', 'dos' ] }
|
119
|
+
|
120
|
+
---
|
121
|
+
test: Nested Mappings
|
122
|
+
brief: |
|
123
|
+
A value in a mapping can be another mapping.
|
124
|
+
yaml: |
|
125
|
+
foo: whatever
|
126
|
+
bar:
|
127
|
+
fruit: apple
|
128
|
+
name: steve
|
129
|
+
sport: baseball
|
130
|
+
perl: |
|
131
|
+
{ foo => 'whatever',
|
132
|
+
bar => {
|
133
|
+
fruit => 'apple',
|
134
|
+
name => 'steve',
|
135
|
+
sport => 'baseball'
|
136
|
+
}
|
137
|
+
}
|
138
|
+
python: |
|
139
|
+
[
|
140
|
+
{'foo': 'whatever',
|
141
|
+
'bar': {
|
142
|
+
'fruit': 'apple',
|
143
|
+
'name': 'steve',
|
144
|
+
'sport': 'baseball'
|
145
|
+
}
|
146
|
+
}
|
147
|
+
]
|
148
|
+
ruby: |
|
149
|
+
{ 'foo' => 'whatever',
|
150
|
+
'bar' => {
|
151
|
+
'fruit' => 'apple',
|
152
|
+
'name' => 'steve',
|
153
|
+
'sport' => 'baseball'
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
---
|
158
|
+
test: Mixed Mapping
|
159
|
+
brief: |
|
160
|
+
A mapping can contain any assortment
|
161
|
+
of mappings and sequences as values.
|
162
|
+
yaml: |
|
163
|
+
foo: whatever
|
164
|
+
bar:
|
165
|
+
-
|
166
|
+
fruit: apple
|
167
|
+
name: steve
|
168
|
+
sport: baseball
|
169
|
+
- more
|
170
|
+
-
|
171
|
+
python: rocks
|
172
|
+
perl: papers
|
173
|
+
ruby: scissorses
|
174
|
+
perl: |
|
175
|
+
{ foo => 'whatever',
|
176
|
+
bar => [
|
177
|
+
{
|
178
|
+
fruit => 'apple',
|
179
|
+
name => 'steve',
|
180
|
+
sport => 'baseball'
|
181
|
+
},
|
182
|
+
'more',
|
183
|
+
{
|
184
|
+
python => 'rocks',
|
185
|
+
perl => 'papers',
|
186
|
+
ruby => 'scissorses'
|
187
|
+
}
|
188
|
+
]
|
189
|
+
}
|
190
|
+
python: |
|
191
|
+
[
|
192
|
+
{'foo': 'whatever',
|
193
|
+
'bar': [
|
194
|
+
{
|
195
|
+
'fruit': 'apple',
|
196
|
+
'name': 'steve',
|
197
|
+
'sport': 'baseball'
|
198
|
+
},
|
199
|
+
'more',
|
200
|
+
{
|
201
|
+
'python': 'rocks',
|
202
|
+
'perl': 'papers',
|
203
|
+
'ruby': 'scissorses'
|
204
|
+
}
|
205
|
+
]
|
206
|
+
}
|
207
|
+
]
|
208
|
+
ruby: |
|
209
|
+
{ 'foo' => 'whatever',
|
210
|
+
'bar' => [
|
211
|
+
{
|
212
|
+
'fruit' => 'apple',
|
213
|
+
'name' => 'steve',
|
214
|
+
'sport' => 'baseball'
|
215
|
+
},
|
216
|
+
'more',
|
217
|
+
{
|
218
|
+
'python' => 'rocks',
|
219
|
+
'perl' => 'papers',
|
220
|
+
'ruby' => 'scissorses'
|
221
|
+
}
|
222
|
+
]
|
223
|
+
}
|
224
|
+
|
225
|
+
---
|
226
|
+
test: Mapping-in-Sequence Shortcut
|
227
|
+
brief: |
|
228
|
+
If you are adding a mapping to a sequence, you
|
229
|
+
can place the mapping on the same line as the
|
230
|
+
dash as a shortcut.
|
231
|
+
yaml: |
|
232
|
+
- work on YAML.py:
|
233
|
+
- work on Store
|
234
|
+
perl: |
|
235
|
+
[ { 'work on YAML.py' => ['work on Store'] } ]
|
236
|
+
python: |
|
237
|
+
[
|
238
|
+
[ {'work on YAML.py': ['work on Store']} ]
|
239
|
+
]
|
240
|
+
ruby: |
|
241
|
+
[ { 'work on YAML.py' => ['work on Store'] } ]
|
242
|
+
|
243
|
+
---
|
244
|
+
test: Sequence-in-Mapping Shortcut
|
245
|
+
brief: |
|
246
|
+
The dash in a sequence counts as indentation, so
|
247
|
+
you can add a sequence inside of a mapping without
|
248
|
+
needing spaces as indentation.
|
249
|
+
yaml: |
|
250
|
+
allow:
|
251
|
+
- 'localhost'
|
252
|
+
- '%.sourceforge.net'
|
253
|
+
- '%.freepan.org'
|
254
|
+
perl: |
|
255
|
+
{ 'allow' => [ 'localhost', '%.sourceforge.net', '%.freepan.org' ] }
|
256
|
+
python: |
|
257
|
+
[
|
258
|
+
{ 'allow': [ 'localhost', '%.sourceforge.net', '%.freepan.org' ] }
|
259
|
+
]
|
260
|
+
ruby: |
|
261
|
+
{ 'allow' => [ 'localhost', '%.sourceforge.net', '%.freepan.org' ] }
|
262
|
+
|
263
|
+
---
|
264
|
+
test: Merge key
|
265
|
+
brief: |
|
266
|
+
A merge key ('<<') can be used in a mapping to insert other mappings. If
|
267
|
+
the value associated with the merge key is a mapping, each of its key/value
|
268
|
+
pairs is inserted into the current mapping.
|
269
|
+
yaml: |
|
270
|
+
mapping:
|
271
|
+
name: Joe
|
272
|
+
job: Accountant
|
273
|
+
<<:
|
274
|
+
age: 38
|
275
|
+
ruby: |
|
276
|
+
{ 'mapping' =>
|
277
|
+
{ 'name' => 'Joe',
|
278
|
+
'job' => 'Accountant',
|
279
|
+
'age' => 38
|
280
|
+
}
|
281
|
+
}
|
282
|
+
|
@@ -0,0 +1,78 @@
|
|
1
|
+
---
|
2
|
+
test: One Element Mapping
|
3
|
+
brief: |
|
4
|
+
A mapping with one key/value pair
|
5
|
+
yaml: |
|
6
|
+
---
|
7
|
+
foo: bar
|
8
|
+
perl: |
|
9
|
+
{foo => 'bar'}
|
10
|
+
ruby: |
|
11
|
+
{ 'foo' => 'bar' }
|
12
|
+
|
13
|
+
---
|
14
|
+
test: Multi Element Mapping
|
15
|
+
brief: |
|
16
|
+
More than one key/value pair
|
17
|
+
yaml: |
|
18
|
+
---
|
19
|
+
red: baron
|
20
|
+
white: walls
|
21
|
+
blue: berries
|
22
|
+
perl: |
|
23
|
+
{
|
24
|
+
red => 'baron',
|
25
|
+
white => 'walls',
|
26
|
+
blue => 'berries',
|
27
|
+
}
|
28
|
+
ruby: |
|
29
|
+
{
|
30
|
+
'red' => 'baron',
|
31
|
+
'white' => 'walls',
|
32
|
+
'blue' => 'berries',
|
33
|
+
}
|
34
|
+
|
35
|
+
---
|
36
|
+
test: Values aligned
|
37
|
+
brief: |
|
38
|
+
Often times human editors of documents will align the values even
|
39
|
+
though YAML emitters generally don't.
|
40
|
+
yaml: |
|
41
|
+
---
|
42
|
+
red: baron
|
43
|
+
white: walls
|
44
|
+
blue: berries
|
45
|
+
perl: |
|
46
|
+
{
|
47
|
+
red => 'baron',
|
48
|
+
white => 'walls',
|
49
|
+
blue => 'berries',
|
50
|
+
}
|
51
|
+
ruby: |
|
52
|
+
{
|
53
|
+
'red' => 'baron',
|
54
|
+
'white' => 'walls',
|
55
|
+
'blue' => 'berries',
|
56
|
+
}
|
57
|
+
|
58
|
+
---
|
59
|
+
test: Colons aligned
|
60
|
+
brief: |
|
61
|
+
Spaces can come before the ': ' key/value separator.
|
62
|
+
yaml: |
|
63
|
+
---
|
64
|
+
red : baron
|
65
|
+
white : walls
|
66
|
+
blue : berries
|
67
|
+
perl: |
|
68
|
+
{
|
69
|
+
red => 'baron',
|
70
|
+
white => 'walls',
|
71
|
+
blue => 'berries',
|
72
|
+
}
|
73
|
+
ruby: |
|
74
|
+
{
|
75
|
+
'red' => 'baron',
|
76
|
+
'white' => 'walls',
|
77
|
+
'blue' => 'berries',
|
78
|
+
}
|
File without changes
|
@@ -0,0 +1,102 @@
|
|
1
|
+
--- %YAML:1.0
|
2
|
+
test: Trailing Document Separator
|
3
|
+
brief: >
|
4
|
+
You can separate YAML documents
|
5
|
+
with a string of three dashes.
|
6
|
+
yaml: |
|
7
|
+
- foo: 1
|
8
|
+
bar: 2
|
9
|
+
---
|
10
|
+
more: stuff
|
11
|
+
python: |
|
12
|
+
[
|
13
|
+
[ { 'foo': 1, 'bar': 2 } ],
|
14
|
+
{ 'more': 'stuff' }
|
15
|
+
]
|
16
|
+
ruby: |
|
17
|
+
[ { 'foo' => 1, 'bar' => 2 } ]
|
18
|
+
|
19
|
+
---
|
20
|
+
test: Leading Document Separator
|
21
|
+
brief: >
|
22
|
+
You can explicity give an opening
|
23
|
+
document separator to your YAML stream.
|
24
|
+
yaml: |
|
25
|
+
---
|
26
|
+
- foo: 1
|
27
|
+
bar: 2
|
28
|
+
---
|
29
|
+
more: stuff
|
30
|
+
python: |
|
31
|
+
[
|
32
|
+
[ {'foo': 1, 'bar': 2}],
|
33
|
+
{'more': 'stuff'}
|
34
|
+
]
|
35
|
+
ruby: |
|
36
|
+
[ { 'foo' => 1, 'bar' => 2 } ]
|
37
|
+
|
38
|
+
---
|
39
|
+
test: YAML Header
|
40
|
+
brief: >
|
41
|
+
The opening separator can contain directives
|
42
|
+
to the YAML parser, such as the version
|
43
|
+
number.
|
44
|
+
yaml: |
|
45
|
+
--- %YAML:1.0
|
46
|
+
foo: 1
|
47
|
+
bar: 2
|
48
|
+
python: |
|
49
|
+
[
|
50
|
+
{ 'foo': 1, 'bar': 2 }
|
51
|
+
]
|
52
|
+
ruby: |
|
53
|
+
y = YAML::Stream.new
|
54
|
+
y.add( { 'foo' => 1, 'bar' => 2 } )
|
55
|
+
documents: 1
|
56
|
+
|
57
|
+
---
|
58
|
+
test: Red Herring Document Separator
|
59
|
+
brief: >
|
60
|
+
Separators included in blocks or strings
|
61
|
+
are treated as blocks or strings, as the
|
62
|
+
document separator should have no indentation
|
63
|
+
preceding it.
|
64
|
+
yaml: |
|
65
|
+
foo: |
|
66
|
+
---
|
67
|
+
python: |
|
68
|
+
[
|
69
|
+
{ 'foo': "---\n" }
|
70
|
+
]
|
71
|
+
ruby: |
|
72
|
+
{ 'foo' => "---\n" }
|
73
|
+
|
74
|
+
---
|
75
|
+
test: Multiple Document Separators in Block
|
76
|
+
brief: >
|
77
|
+
This technique allows you to embed other YAML
|
78
|
+
documents within literal blocks.
|
79
|
+
yaml: |
|
80
|
+
foo: |
|
81
|
+
---
|
82
|
+
foo: bar
|
83
|
+
---
|
84
|
+
yo: baz
|
85
|
+
bar: |
|
86
|
+
fooness
|
87
|
+
python: |
|
88
|
+
[
|
89
|
+
{ 'foo': flushLeft("""
|
90
|
+
---
|
91
|
+
foo: bar
|
92
|
+
---
|
93
|
+
yo: baz
|
94
|
+
"""),
|
95
|
+
'bar': "fooness\n"
|
96
|
+
}
|
97
|
+
]
|
98
|
+
ruby: |
|
99
|
+
{
|
100
|
+
'foo' => "---\nfoo: bar\n---\nyo: baz\n",
|
101
|
+
'bar' => "fooness\n"
|
102
|
+
}
|