|
maxious
|
1 |
# |
|
|
2 |
# S P Y C |
|
|
3 |
# a simple php yaml class |
|
|
4 |
# |
|
|
5 |
# authors: [vlad andersen (vlad.andersen@gmail.com), chris wanstrath (chris@ozmm.org)] |
|
|
6 |
# websites: [http://www.yaml.org, http://spyc.sourceforge.net/] |
|
|
7 |
# license: [MIT License, http://www.opensource.org/licenses/mit-license.php] |
|
|
8 |
# copyright: (c) 2005-2006 Chris Wanstrath, 2006-2009 Vlad Andersen |
|
|
9 |
# |
|
|
10 |
# spyc.yml - A file containing the YAML that Spyc understands. |
|
|
11 |
|
|
|
12 |
--- |
|
|
13 |
|
|
|
14 |
# Mappings - with proper types |
|
|
15 |
String: Anyone's name, really. |
|
|
16 |
Int: 13 |
|
|
17 |
True: true |
|
|
18 |
False: false |
|
|
19 |
Zero: 0 |
|
|
20 |
Null: NULL |
|
|
21 |
Float: 5.34 |
|
|
22 |
|
|
|
23 |
# A sequence |
|
|
24 |
- PHP Class |
|
|
25 |
- Basic YAML Loader |
|
|
26 |
- Very Basic YAML Dumper |
|
|
27 |
|
|
|
28 |
# A sequence of a sequence |
|
|
29 |
- |
|
|
30 |
- YAML is so easy to learn. |
|
|
31 |
- Your config files will never be the same. |
|
|
32 |
|
|
|
33 |
# Sequence of mappings |
|
|
34 |
- |
|
|
35 |
cpu: 1.5ghz |
|
|
36 |
ram: 1 gig |
|
|
37 |
os : os x 10.4.1 |
|
|
38 |
|
|
|
39 |
# Mapped sequence |
|
|
40 |
domains: |
|
|
41 |
- yaml.org |
|
|
42 |
- php.net |
|
|
43 |
|
|
|
44 |
# A sequence like this. |
|
|
45 |
- program: Adium |
|
|
46 |
platform: OS X |
|
|
47 |
type: Chat Client |
|
|
48 |
|
|
|
49 |
# A folded block as a mapped value |
|
|
50 |
no time: > |
|
|
51 |
There isn't any time |
|
|
52 |
for your tricks! |
|
|
53 |
|
|
|
54 |
Do you understand? |
|
|
55 |
|
|
|
56 |
# A literal block as a mapped value |
|
|
57 |
some time: | |
|
|
58 |
There is nothing but time |
|
|
59 |
for your tricks. |
|
|
60 |
|
|
|
61 |
# Crazy combinations |
|
|
62 |
databases: |
|
|
63 |
- name: spartan |
|
|
64 |
notes: |
|
|
65 |
- Needs to be backed up |
|
|
66 |
- Needs to be normalized |
|
|
67 |
type: mysql |
|
|
68 |
|
|
|
69 |
# You can be a bit tricky |
|
|
70 |
"if: you'd": like |
|
|
71 |
|
|
|
72 |
# Inline sequences |
|
|
73 |
- [One, Two, Three, Four] |
|
|
74 |
|
|
|
75 |
# Nested Inline Sequences |
|
|
76 |
- [One, [Two, And, Three], Four, Five] |
|
|
77 |
|
|
|
78 |
# Nested Nested Inline Sequences |
|
|
79 |
- [This, [Is, Getting, [Ridiculous, Guys]], Seriously, [Show, Mercy]] |
|
|
80 |
|
|
|
81 |
# Inline mappings |
|
|
82 |
- {name: chris, age: young, brand: lucky strike} |
|
|
83 |
|
|
|
84 |
# Nested inline mappings |
|
|
85 |
- {name: mark, age: older than chris, brand: [marlboro, lucky strike]} |
|
|
86 |
|
|
|
87 |
# References -- they're shaky, but functional |
|
|
88 |
dynamic languages: &DLANGS |
|
|
89 |
- Perl |
|
|
90 |
- Python |
|
|
91 |
- PHP |
|
|
92 |
- Ruby |
|
|
93 |
compiled languages: &CLANGS |
|
|
94 |
- C/C++ |
|
|
95 |
- Java |
|
|
96 |
all languages: |
|
|
97 |
- *DLANGS |
|
|
98 |
- *CLANGS |
|
|
99 |
|
|
|
100 |
# Added in .2.2: Escaped quotes |
|
|
101 |
- you know, this shouldn't work. but it does. |
|
|
102 |
- 'that''s my value.' |
|
|
103 |
- 'again, that\'s my value.' |
|
|
104 |
- "here's to \"quotes\", boss." |
|
|
105 |
|
|
|
106 |
# added in .2.3 |
|
|
107 |
- {name: "Foo, Bar's", age: 20} |
|
|
108 |
|
|
|
109 |
# Added in .2.4: bug [ 1418193 ] Quote Values in Nested Arrays |
|
|
110 |
- [a, ['1', "2"], b] |
|
|
111 |
|
|
|
112 |
# Added in .2.4: malformed YAML |
|
|
113 |
all |
|
|
114 |
javascripts: [dom1.js, dom.js] |
|
|
115 |
|
|
|
116 |
# Added in .2 |
|
|
117 |
1040: Ooo, a numeric key! # And working comments? Wow! Colons in comments: a menace (0.3). |
|
|
118 |
|
|
|
119 |
hash_1: Hash #and a comment |
|
|
120 |
hash_2: "Hash #and a comment" |
|
|
121 |
"hash#3": "Hash (#) can appear in key too" |
|
|
122 |
|
|
|
123 |
float_test: 1.0 |
|
|
124 |
float_test_with_quotes: '1.0' |
|
|
125 |
float_inverse_test: 001 |
|
|
126 |
|
|
|
127 |
a_really_large_number: 115792089237316195423570985008687907853269984665640564039457584007913129639936 # 2^256 |
|
|
128 |
|
|
|
129 |
int array: [ 1, 2, 3 ] |
|
|
130 |
|
|
|
131 |
array on several lines: |
|
|
132 |
[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, |
|
|
133 |
10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ] |
|
|
134 |
|
|
|
135 |
morelesskey: "<value>" |
|
|
136 |
|
|
|
137 |
array_of_zero: [0] |
|
|
138 |
sophisticated_array_of_zero: {rx: {tx: [0]} } |
|
|
139 |
|
|
|
140 |
switches: |
|
|
141 |
- { row: 0, col: 0, func: {tx: [0, 1]} } |
|
|
142 |
|
|
|
143 |
empty_sequence: [ ] |
|
|
144 |
empty_hash: { } |
|
|
145 |
|
|
|
146 |
special_characters: "[{]]{{]]" |
|
|
147 |
|
|
|
148 |
asterisks: "*" |
|
|
149 |
|
|
|
150 |
empty_key: |
|
|
151 |
: |
|
|
152 |
key: value |
|
|
153 |
|
|
|
154 |
trailing_colon: "foo:" |
|
|
155 |
|
|
|
156 |
multiline_items: |
|
|
157 |
- type: SomeItem |
|
|
158 |
values: [blah, blah, blah, |
|
|
159 |
blah] |
|
|
160 |
ints: [2, 54, 12, |
|
|
161 |
2143] |
|
|
162 |
|
|
|
163 |
many_lines: | |
|
|
164 |
A quick |
|
|
165 |
fox |
|
|
166 |
|
|
|
167 |
|
|
|
168 |
jumped |
|
|
169 |
over |
|
|
170 |
|
|
|
171 |
|
|
|
172 |
|
|
|
173 |
|
|
|
174 |
|
|
|
175 |
a lazy |
|
|
176 |
|
|
|
177 |
|
|
|
178 |
|
|
|
179 |
dog |
|
|
180 |
|
|
|
181 |
|
|
|
182 |
werte: |
|
|
183 |
1: nummer 1 |
|
|
184 |
0: Stunde 0 |
|
|
185 |
|
|
|
186 |
noindent_records: |
|
|
187 |
- record1: value1 |
|
|
188 |
- record2: value2 |
|
|
189 |
|
|
|
190 |
"a:1": [1000] |
|
|
191 |
"a:2": |
|
|
192 |
- 2000 |
|
|
193 |
|
|
|
194 |
# [Endloop] |
|
|
195 |
endloop: | |
|
|
196 |
Does this line in the end indeed make Spyc go to an infinite loop? |