psych 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19e0438e0f11c78efb5dedbb0f0e8f727d836658
4
- data.tar.gz: f580bcc3ef9f64d36a7874c4142a3ee93468e83e
3
+ metadata.gz: 70e18407966f1c51b40310189546fd35c97055da
4
+ data.tar.gz: 90878220005cb871ac09a83f5adc238fdf4485d1
5
5
  SHA512:
6
- metadata.gz: cb94e783648d0e138b975ee924630a9142904175add0314cdf0a8f963be80ccdb0cadd6fc540edeb009be04db05b091b7c915427d82af64687cb8660bac03105
7
- data.tar.gz: 9bd7dbafd37f191394e492c0ad45652085be2577b64c467a997164d6d8424be48cec092768ce74dd2a35c48b320f97d54c7c42afffa81b3c19160c3cfdf097f3
6
+ metadata.gz: fc9beff6914abbf499b6c93986e2fb9cae11053e76349dd238f455edee78d8b57ff296f09095a485154f6aee4fe3af982bdccd3436a57021fdd2750aa53a02a2
7
+ data.tar.gz: 75ae858c3fe0f2a98de8047f3ff79c0e9cf60c134dacedc93d8c897cd2d4c8bd4d301f0001b1537f51f85de5b08817ec3ca15607f05a07677dfc895c3b2bc966
@@ -2,6 +2,7 @@ rvm:
2
2
  - 1.9.2
3
3
  - 1.9.3
4
4
  - 2.0.0
5
+ - 2.1.0
5
6
  before_script:
6
7
  - gem install isolate
7
8
  - gem install hoe
@@ -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
@@ -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(empty, emitter->tag_directives)) {
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);
@@ -1,11 +1,10 @@
1
-
2
1
  #define PACKAGE_NAME "yaml"
3
2
  #define PACKAGE_TARNAME "yaml"
4
- #define PACKAGE_VERSION "0.1.5"
5
- #define PACKAGE_STRING "yaml 0.1.5"
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 5
11
- #define YAML_VERSION_STRING "0.1.5"
9
+ #define YAML_VERSION_PATCH 6
10
+ #define YAML_VERSION_STRING "0.1.6"
@@ -53,7 +53,7 @@
53
53
  #define WRITE_BREAK(emitter,string) \
54
54
  (FLUSH(emitter) \
55
55
  && (CHECK(string,'\n') ? \
56
- (PUT_BREAK(emitter), \
56
+ ((void)PUT_BREAK(emitter), \
57
57
  string.pointer ++, \
58
58
  1) : \
59
59
  (COPY(emitter->buffer,string), \
@@ -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
- dummy_mark = POP(parser, parser->marks);
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
- dummy_mark = POP(parser, parser->marks);
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
- dummy_mark = POP(parser, parser->marks);
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
- dummy_mark = POP(parser, parser->marks);
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;
@@ -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
- dummy_key = POP(parser, parser->simple_keys);
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
- ((stack).start == (stack).top)
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) ? \
@@ -217,7 +217,7 @@ require 'psych/class_loader'
217
217
 
218
218
  module Psych
219
219
  # The version is Psych you're using
220
- VERSION = '2.0.4'
220
+ VERSION = '2.0.5'
221
221
 
222
222
  # The version of libyaml Psych is using
223
223
  LIBYAML_VERSION = Psych.libyaml_version.join '.'
@@ -75,6 +75,8 @@ module Psych
75
75
  class_loader.date_time
76
76
  require 'date'
77
77
  @ss.parse_time(o.value).to_datetime
78
+ when '!ruby/encoding'
79
+ ::Encoding.find o.value
78
80
  when "!ruby/object:Complex"
79
81
  class_loader.complex
80
82
  Complex(o.value)
@@ -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
@@ -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'))
@@ -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
- str = Psych.load Psych.dump food
140
+ Psych.load Psych.dump food
141
141
  assert_equal ivar, food.instance_variable_get(:@we_built_this_city)
142
142
  end
143
143
 
@@ -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
- scheme, domain, type = type.split( ':', 3 )
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
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-02-05 00:00:00.000000000 Z
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.1
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