psych 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.rdoc +17 -0
- data/ext/psych/yaml/api.c +1 -1
- data/ext/psych/yaml/config.h +4 -5
- data/ext/psych/yaml/emitter.c +1 -1
- data/ext/psych/yaml/parser.c +4 -8
- data/ext/psych/yaml/scanner.c +4 -3
- data/ext/psych/yaml/yaml_private.h +7 -3
- data/lib/psych.rb +1 -1
- data/lib/psych/visitors/to_ruby.rb +2 -0
- data/lib/psych/visitors/yaml_tree.rb +5 -0
- data/test/psych/test_encoding.rb +5 -0
- data/test/psych/test_string.rb +1 -1
- data/test/psych/test_yaml.rb +1 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70e18407966f1c51b40310189546fd35c97055da
|
4
|
+
data.tar.gz: 90878220005cb871ac09a83f5adc238fdf4485d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc9beff6914abbf499b6c93986e2fb9cae11053e76349dd238f455edee78d8b57ff296f09095a485154f6aee4fe3af982bdccd3436a57021fdd2750aa53a02a2
|
7
|
+
data.tar.gz: 75ae858c3fe0f2a98de8047f3ff79c0e9cf60c134dacedc93d8c897cd2d4c8bd4d301f0001b1537f51f85de5b08817ec3ca15607f05a07677dfc895c3b2bc966
|
data/.travis.yml
CHANGED
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
2014-03-27 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
2
|
+
|
3
|
+
* ext/psych/yaml/scanner.c: merge libyaml 0.1.6
|
4
|
+
* ext/psych/yaml/yaml_private.h: ditto
|
5
|
+
|
6
|
+
Sat Mar 1 11:08:00 2014 Aaron Patterson <aaron@tenderlovemaking.com>
|
7
|
+
|
8
|
+
* ext/psych/lib/psych/visitors/yaml_tree.rb: support dumping Encoding
|
9
|
+
objects.
|
10
|
+
|
11
|
+
* ext/psych/lib/psych/visitors/to_ruby.rb: support loading Encoding
|
12
|
+
objects.
|
13
|
+
|
14
|
+
* test/psych/test_encoding.rb: add test
|
15
|
+
|
16
|
+
* ext/psych/lib/psych.rb: add version
|
17
|
+
|
1
18
|
Wed Feb 5 10:11:36 2014 Zachary Scott <e@zzak.io>
|
2
19
|
|
3
20
|
* ext/psych/yaml/config.h: bump libyaml to 0.1.5
|
data/ext/psych/yaml/api.c
CHANGED
@@ -395,7 +395,7 @@ yaml_emitter_delete(yaml_emitter_t *emitter)
|
|
395
395
|
}
|
396
396
|
QUEUE_DEL(emitter, emitter->events);
|
397
397
|
STACK_DEL(emitter, emitter->indents);
|
398
|
-
while (!STACK_EMPTY(
|
398
|
+
while (!STACK_EMPTY(emitter, emitter->tag_directives)) {
|
399
399
|
yaml_tag_directive_t tag_directive = POP(emitter, emitter->tag_directives);
|
400
400
|
yaml_free(tag_directive.handle);
|
401
401
|
yaml_free(tag_directive.prefix);
|
data/ext/psych/yaml/config.h
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
|
2
1
|
#define PACKAGE_NAME "yaml"
|
3
2
|
#define PACKAGE_TARNAME "yaml"
|
4
|
-
#define PACKAGE_VERSION "0.1.
|
5
|
-
#define PACKAGE_STRING "yaml 0.1.
|
3
|
+
#define PACKAGE_VERSION "0.1.6"
|
4
|
+
#define PACKAGE_STRING "yaml 0.1.6"
|
6
5
|
#define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component libyaml"
|
7
6
|
#define PACKAGE_URL ""
|
8
7
|
#define YAML_VERSION_MAJOR 0
|
9
8
|
#define YAML_VERSION_MINOR 1
|
10
|
-
#define YAML_VERSION_PATCH
|
11
|
-
#define YAML_VERSION_STRING "0.1.
|
9
|
+
#define YAML_VERSION_PATCH 6
|
10
|
+
#define YAML_VERSION_STRING "0.1.6"
|
data/ext/psych/yaml/emitter.c
CHANGED
data/ext/psych/yaml/parser.c
CHANGED
@@ -759,9 +759,8 @@ yaml_parser_parse_block_sequence_entry(yaml_parser_t *parser,
|
|
759
759
|
|
760
760
|
else if (token->type == YAML_BLOCK_END_TOKEN)
|
761
761
|
{
|
762
|
-
yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
|
763
762
|
parser->state = POP(parser, parser->states);
|
764
|
-
|
763
|
+
(void)POP(parser, parser->marks);
|
765
764
|
SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
|
766
765
|
SKIP_TOKEN(parser);
|
767
766
|
return 1;
|
@@ -869,9 +868,8 @@ yaml_parser_parse_block_mapping_key(yaml_parser_t *parser,
|
|
869
868
|
|
870
869
|
else if (token->type == YAML_BLOCK_END_TOKEN)
|
871
870
|
{
|
872
|
-
yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
|
873
871
|
parser->state = POP(parser, parser->states);
|
874
|
-
|
872
|
+
(void)POP(parser, parser->marks);
|
875
873
|
MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
|
876
874
|
SKIP_TOKEN(parser);
|
877
875
|
return 1;
|
@@ -952,7 +950,6 @@ yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser,
|
|
952
950
|
yaml_event_t *event, int first)
|
953
951
|
{
|
954
952
|
yaml_token_t *token;
|
955
|
-
yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
|
956
953
|
|
957
954
|
if (first) {
|
958
955
|
token = PEEK_TOKEN(parser);
|
@@ -997,7 +994,7 @@ yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser,
|
|
997
994
|
}
|
998
995
|
|
999
996
|
parser->state = POP(parser, parser->states);
|
1000
|
-
|
997
|
+
(void)POP(parser, parser->marks);
|
1001
998
|
SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
|
1002
999
|
SKIP_TOKEN(parser);
|
1003
1000
|
return 1;
|
@@ -1104,7 +1101,6 @@ yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser,
|
|
1104
1101
|
yaml_event_t *event, int first)
|
1105
1102
|
{
|
1106
1103
|
yaml_token_t *token;
|
1107
|
-
yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
|
1108
1104
|
|
1109
1105
|
if (first) {
|
1110
1106
|
token = PEEK_TOKEN(parser);
|
@@ -1158,7 +1154,7 @@ yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser,
|
|
1158
1154
|
}
|
1159
1155
|
|
1160
1156
|
parser->state = POP(parser, parser->states);
|
1161
|
-
|
1157
|
+
(void)POP(parser, parser->marks);
|
1162
1158
|
MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
|
1163
1159
|
SKIP_TOKEN(parser);
|
1164
1160
|
return 1;
|
data/ext/psych/yaml/scanner.c
CHANGED
@@ -1193,11 +1193,9 @@ yaml_parser_increase_flow_level(yaml_parser_t *parser)
|
|
1193
1193
|
static int
|
1194
1194
|
yaml_parser_decrease_flow_level(yaml_parser_t *parser)
|
1195
1195
|
{
|
1196
|
-
yaml_simple_key_t dummy_key; /* Used to eliminate a compiler warning. */
|
1197
|
-
|
1198
1196
|
if (parser->flow_level) {
|
1199
1197
|
parser->flow_level --;
|
1200
|
-
|
1198
|
+
(void)POP(parser, parser->simple_keys);
|
1201
1199
|
}
|
1202
1200
|
|
1203
1201
|
return 1;
|
@@ -2631,6 +2629,9 @@ yaml_parser_scan_tag_uri(yaml_parser_t *parser, int directive,
|
|
2631
2629
|
/* Check if it is a URI-escape sequence. */
|
2632
2630
|
|
2633
2631
|
if (CHECK(parser->buffer, '%')) {
|
2632
|
+
if (!STRING_EXTEND(parser, string))
|
2633
|
+
goto error;
|
2634
|
+
|
2634
2635
|
if (!yaml_parser_scan_uri_escapes(parser,
|
2635
2636
|
directive, start_mark, &string)) goto error;
|
2636
2637
|
}
|
@@ -146,9 +146,12 @@ yaml_string_join(
|
|
146
146
|
(string).start = (string).pointer = (string).end = 0)
|
147
147
|
|
148
148
|
#define STRING_EXTEND(context,string) \
|
149
|
-
(((string).pointer+5 < (string).end)
|
149
|
+
((((string).pointer+5 < (string).end) \
|
150
150
|
|| yaml_string_extend(&(string).start, \
|
151
|
-
&(string).pointer, &(string).end))
|
151
|
+
&(string).pointer, &(string).end)) ? \
|
152
|
+
1 : \
|
153
|
+
((context)->error = YAML_MEMORY_ERROR, \
|
154
|
+
0))
|
152
155
|
|
153
156
|
#define CLEAR(context,string) \
|
154
157
|
((string).pointer = (string).start, \
|
@@ -433,7 +436,8 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
|
|
433
436
|
(stack).start = (stack).top = (stack).end = 0)
|
434
437
|
|
435
438
|
#define STACK_EMPTY(context,stack) \
|
436
|
-
((
|
439
|
+
((void)(context), \
|
440
|
+
((stack).start == (stack).top))
|
437
441
|
|
438
442
|
#define STACK_LIMIT(context,stack,size) \
|
439
443
|
((stack).top - (stack).start < (size) ? \
|
data/lib/psych.rb
CHANGED
@@ -157,6 +157,11 @@ module Psych
|
|
157
157
|
@emitter.end_sequence
|
158
158
|
end
|
159
159
|
|
160
|
+
def visit_Encoding o
|
161
|
+
tag = "!ruby/encoding"
|
162
|
+
@emitter.scalar o.name, nil, tag, false, false, Nodes::Scalar::ANY
|
163
|
+
end
|
164
|
+
|
160
165
|
def visit_Object o
|
161
166
|
tag = Psych.dump_tags[o.class]
|
162
167
|
unless tag
|
data/test/psych/test_encoding.rb
CHANGED
@@ -31,6 +31,11 @@ module Psych
|
|
31
31
|
@emitter = Psych::Emitter.new @buffer
|
32
32
|
end
|
33
33
|
|
34
|
+
def test_dump_load_encoding_object
|
35
|
+
assert_cycle Encoding::US_ASCII
|
36
|
+
assert_cycle Encoding::UTF_8
|
37
|
+
end
|
38
|
+
|
34
39
|
def test_transcode_shiftjis
|
35
40
|
str = "こんにちは!"
|
36
41
|
loaded = Psych.load("--- こんにちは!".encode('SHIFT_JIS'))
|
data/test/psych/test_string.rb
CHANGED
@@ -137,7 +137,7 @@ string: &70121654388580 !ruby/string
|
|
137
137
|
ivar = "on rock and roll"
|
138
138
|
food.instance_variable_set(:@we_built_this_city, ivar)
|
139
139
|
|
140
|
-
|
140
|
+
Psych.load Psych.dump food
|
141
141
|
assert_equal ivar, food.instance_variable_get(:@we_built_this_city)
|
142
142
|
end
|
143
143
|
|
data/test/psych/test_yaml.rb
CHANGED
@@ -250,7 +250,6 @@ EOY
|
|
250
250
|
|
251
251
|
def test_spec_mapping_between_sequences
|
252
252
|
# Complex key #1
|
253
|
-
dj = Date.new( 2001, 7, 23 )
|
254
253
|
assert_parse_only(
|
255
254
|
{ [ 'Detroit Tigers', 'Chicago Cubs' ] => [ Date.new( 2001, 7, 23 ) ],
|
256
255
|
[ 'New York Yankees', 'Atlanta Braves' ] => [ Date.new( 2001, 7, 2 ), Date.new( 2001, 8, 12 ), Date.new( 2001, 8, 14 ) ] }, <<EOY
|
@@ -606,7 +605,7 @@ EOY
|
|
606
605
|
def test_spec_domain_prefix
|
607
606
|
customer_proc = proc { |type, val|
|
608
607
|
if Hash === val
|
609
|
-
|
608
|
+
_, _, type = type.split( ':', 3 )
|
610
609
|
val['type'] = "domain #{type}"
|
611
610
|
val
|
612
611
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: psych
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Patterson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
203
|
version: '0'
|
204
204
|
requirements: []
|
205
205
|
rubyforge_project: psych
|
206
|
-
rubygems_version: 2.2.
|
206
|
+
rubygems_version: 2.2.2
|
207
207
|
signing_key:
|
208
208
|
specification_version: 4
|
209
209
|
summary: Psych is a YAML parser and emitter
|