psych-shopifork 2.0.5 → 2.0.13

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: 9e2f3338b6772bcae59dd47d00176c3dfa5c6f31
4
- data.tar.gz: 82e508c6a44a897d3859f4e9119f996ba65c300a
3
+ metadata.gz: 5f174e67e13c4e70df1d785ebaa88cd16ae4aecf
4
+ data.tar.gz: c7f88164d3a4b196277eee0baeccdaff9cae8664
5
5
  SHA512:
6
- metadata.gz: e4d6c099340d0d0a38e29c7fdfffeb088fa35f342785b98f89814ad5fe781ecb51db37cd934f11eb9cab548c5af97989cbc60237988b0e3a6b4cd52415634a08
7
- data.tar.gz: 70690a0824b6bba21d3e65dbd4cbeb97ef7d27c72d1fc617faf279d87d8556bc205532b7da132a0186f0444821a60dd1ad6fdfbdef88c5425bf7e4850fa4f11c
6
+ metadata.gz: f860d1ced6e42df06baadc181c48fb1821548fb37e685616628cd5e14d6d58128540cbe6374fcedae41a93af7dfc062ea2dcb166360387e14c4080638cac1928
7
+ data.tar.gz: 014b4621ae3cca4ce82995995071c357916debb410205035aee75f5546e284776ca25a461e61d85b3be594a9770a63db3ec5a8984723670d49d37b91b794b2ce
@@ -3,8 +3,14 @@ rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
5
  - 2.1.0
6
+ - 2.2.0
7
+ - ruby-head
8
+ - rbx-2
6
9
  before_script:
7
- - gem install isolate
8
10
  - gem install hoe
9
11
  - gem install rake-compiler
10
- script: rake isolate test
12
+ - gem install minitest -v '~> 5.0'
13
+ script: rake test
14
+ matrix:
15
+ allow_failures:
16
+ - rvm: rbx-2
@@ -1,3 +1,90 @@
1
+ Fri Feb 6 17:47:05 2015 Aaron Patterson <aaron@tenderlovemaking.com>
2
+
3
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: register nodes when
4
+ dumping objects with custom coders. [ruby-core:66215] [Bug #10496]
5
+
6
+ * test/psych/test_coder.rb: test for fix
7
+
8
+ Fri Feb 6 16:58:31 2015 Aaron Patterson <aaron@tenderlovemaking.com>
9
+
10
+ * ext/psych/lib/psych/visitors/to_ruby.rb: fix support for regular
11
+ expressions with newlines. tenderlove/psych#222
12
+
13
+ * test/psych/test_yaml.rb: test for change.
14
+
15
+ Thu Jan 29 02:34:27 2015 Aaron Patterson <aaron@tenderlovemaking.com>
16
+
17
+ * ext/psych/lib/psych/visitors/to_ruby.rb: fix parsing hashes with
18
+ instance variables when it is referenced multiple times.
19
+ * ext/psych/lib/psych.rb: bump version
20
+ * ext/psych/psych.gemspec: bump version
21
+ * test/psych/test_hash.rb: test for fix
22
+
23
+ Fri Jan 9 07:13:55 2015 Aaron Patterson <aaron@tenderlovemaking.com>
24
+
25
+ * ext/psych/lib/psych/visitors/to_ruby.rb: call `allocate` on hash
26
+ subclasses. Fixes github.com/tenderlove/psych/issues/196
27
+
28
+ * test/psych/test_hash.rb: test for change
29
+
30
+ Fri Jan 9 06:58:43 2015 Aaron Patterson <aaron@tenderlovemaking.com>
31
+
32
+ * ext/psych/lib/psych/visitors/to_ruby.rb: revive hashes with ivars
33
+
34
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: dump hashes with ivars.
35
+ Fixes github.com/psych/issues/43
36
+
37
+ * test/psych/test_hash.rb: test for change
38
+
39
+ Sun Nov 23 13:11:24 2014 Sean Griffin <sean@thoughtbot.com>
40
+
41
+ * lib/psych/visitors/to_ruby.rb: Allow loading any BasicObject that
42
+ defines #marshal_load, fixes #100
43
+ * lib/psych/visitors/yaml_tree.rb: Allow dumping any BasicObject that
44
+ defines #marshal_dump
45
+
46
+ Sat Aug 30 06:39:48 2014 Aaron Patterson <aaron@tenderlovemaking.com>
47
+
48
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: fix NameError dumping and
49
+ loading. Fixes GH #85. Thanks @brentdax for the patch!
50
+ * test/psych/test_exception.rb: test for fix
51
+
52
+ Sat Aug 30 06:23:40 2014 Aaron Patterson <aaron@tenderlovemaking.com>
53
+
54
+ * ext/psych/lib/psych/scalar_scanner.rb: fix loading strings that
55
+ look like integers but have a newline. Fixes GH #189
56
+ * test/psych/test_string.rb: test for fix
57
+
58
+ Sat Aug 30 06:10:39 2014 Aaron Patterson <aaron@tenderlovemaking.com>
59
+
60
+ * ext/psych/lib/psych/visitors/to_ruby.rb: merge keys with a hash
61
+ should merge the hash in to the parent.
62
+ * test/psych/test_merge_keys.rb: test for change. Fixes GH #202
63
+
64
+ Sat Aug 30 06:00:26 2014 Aaron Patterson <aaron@tenderlovemaking.com>
65
+
66
+ * ext/psych/lib/psych/visitors/to_ruby.rb: quoted "<<" strings
67
+ should not be treated as merge keys.
68
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: hashes with keys
69
+ containing "<<" should roundtrip.
70
+ * test/psych/test_merge_keys.rb: test for change. Fixes GH #203
71
+
72
+ Wed Aug 6 03:41:21 2014 Aaron Patterson <aaron@tenderlovemaking.com>
73
+
74
+ * ext/psych/lib/psych/visitors/to_ruby.rb: backwards compatibility for
75
+ hashes emitted by Syck. Github #198
76
+ * test/psych/test_hash.rb: test for change.
77
+
78
+ Fri Jun 6 07:41:41 2014 Aaron Patterson <aaron@tenderlovemaking.com>
79
+
80
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: dump empty symbols with a
81
+ tag so that they can be parsed on input. [Bug #9873] [ruby-core:62825]
82
+ * test/psych/test_symbol.rb: test for change
83
+
84
+ Sun May 25 11:35:41 2014 Zachary Scott <e@zzak.io>
85
+
86
+ * test/psych/*: YAML::ENGINE was removed in [Bug #8344]
87
+
1
88
  2014-03-27 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
2
89
 
3
90
  * ext/psych/yaml/scanner.c: merge libyaml 0.1.6
@@ -79,7 +79,6 @@ test/psych/test_deprecated.rb
79
79
  test/psych/test_document.rb
80
80
  test/psych/test_emitter.rb
81
81
  test/psych/test_encoding.rb
82
- test/psych/test_engine_manager.rb
83
82
  test/psych/test_exception.rb
84
83
  test/psych/test_hash.rb
85
84
  test/psych/test_json_tree.rb
data/Rakefile CHANGED
@@ -9,9 +9,10 @@ class Hoe
9
9
  end
10
10
 
11
11
  gem 'rake-compiler', '>= 0.4.1'
12
+ gem 'minitest', '~> 5.0'
12
13
  require "rake/extensiontask"
13
14
 
14
- Hoe.plugin :doofus, :git, :gemspec, :isolate
15
+ Hoe.plugin :doofus, :git, :gemspec
15
16
 
16
17
  $hoe = Hoe.spec 'psych-shopifork' do
17
18
  license 'MIT'
@@ -23,6 +24,7 @@ $hoe = Hoe.spec 'psych-shopifork' do
23
24
  self.testlib = :minitest
24
25
 
25
26
  extra_dev_deps << ['rake-compiler', '>= 0.4.1']
27
+ extra_dev_deps << ['minitest', '~> 5.0']
26
28
 
27
29
  self.spec_extras = {
28
30
  :extensions => ["ext/psych/extconf.rb"],
@@ -20,7 +20,7 @@ static VALUE libyaml_version(VALUE module)
20
20
 
21
21
  VALUE mPsych;
22
22
 
23
- void Init_psych()
23
+ void Init_psych(void)
24
24
  {
25
25
  mPsych = rb_define_module("Psych");
26
26
 
@@ -29,17 +29,34 @@ static void dealloc(void * ptr)
29
29
  xfree(emitter);
30
30
  }
31
31
 
32
+ #if 0
33
+ static size_t memsize(const void *ptr)
34
+ {
35
+ const yaml_emitter_t *emitter = ptr;
36
+ /* TODO: calculate emitter's size */
37
+ return 0;
38
+ }
39
+ #endif
40
+
41
+ static const rb_data_type_t psych_emitter_type = {
42
+ "Psych/emitter",
43
+ {0, dealloc, 0,},
44
+ 0, 0,
45
+ #ifdef RUBY_TYPED_FREE_IMMEDIATELY
46
+ RUBY_TYPED_FREE_IMMEDIATELY,
47
+ #endif
48
+ };
49
+
32
50
  static VALUE allocate(VALUE klass)
33
51
  {
34
52
  yaml_emitter_t * emitter;
35
-
36
- emitter = xmalloc(sizeof(yaml_emitter_t));
53
+ VALUE obj = TypedData_Make_Struct(klass, yaml_emitter_t, &psych_emitter_type, emitter);
37
54
 
38
55
  yaml_emitter_initialize(emitter);
39
56
  yaml_emitter_set_unicode(emitter, 1);
40
57
  yaml_emitter_set_indent(emitter, 2);
41
58
 
42
- return Data_Wrap_Struct(klass, 0, dealloc, emitter);
59
+ return obj;
43
60
  }
44
61
 
45
62
  /* call-seq: Psych::Emitter.new(io, options = Psych::Emitter::OPTIONS)
@@ -54,7 +71,7 @@ static VALUE initialize(int argc, VALUE *argv, VALUE self)
54
71
  VALUE indent;
55
72
  VALUE canonical;
56
73
 
57
- Data_Get_Struct(self, yaml_emitter_t, emitter);
74
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
58
75
 
59
76
  if (rb_scan_args(argc, argv, "11", &io, &options) == 2) {
60
77
  line_width = rb_funcall(options, id_line_width, 0);
@@ -81,7 +98,7 @@ static VALUE start_stream(VALUE self, VALUE encoding)
81
98
  {
82
99
  yaml_emitter_t * emitter;
83
100
  yaml_event_t event;
84
- Data_Get_Struct(self, yaml_emitter_t, emitter);
101
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
85
102
  Check_Type(encoding, T_FIXNUM);
86
103
 
87
104
  yaml_stream_start_event_initialize(&event, (yaml_encoding_t)NUM2INT(encoding));
@@ -101,7 +118,7 @@ static VALUE end_stream(VALUE self)
101
118
  {
102
119
  yaml_emitter_t * emitter;
103
120
  yaml_event_t event;
104
- Data_Get_Struct(self, yaml_emitter_t, emitter);
121
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
105
122
 
106
123
  yaml_stream_end_event_initialize(&event);
107
124
 
@@ -124,7 +141,7 @@ static VALUE start_document(VALUE self, VALUE version, VALUE tags, VALUE imp)
124
141
  yaml_tag_directive_t * tail = NULL;
125
142
  yaml_event_t event;
126
143
  yaml_version_directive_t version_directive;
127
- Data_Get_Struct(self, yaml_emitter_t, emitter);
144
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
128
145
 
129
146
 
130
147
  Check_Type(version, T_ARRAY);
@@ -198,7 +215,7 @@ static VALUE end_document(VALUE self, VALUE imp)
198
215
  {
199
216
  yaml_emitter_t * emitter;
200
217
  yaml_event_t event;
201
- Data_Get_Struct(self, yaml_emitter_t, emitter);
218
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
202
219
 
203
220
  yaml_document_end_event_initialize(&event, imp ? 1 : 0);
204
221
 
@@ -228,7 +245,7 @@ static VALUE scalar(
228
245
  #ifdef HAVE_RUBY_ENCODING_H
229
246
  rb_encoding *encoding;
230
247
  #endif
231
- Data_Get_Struct(self, yaml_emitter_t, emitter);
248
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
232
249
 
233
250
  Check_Type(value, T_STRING);
234
251
 
@@ -295,7 +312,7 @@ static VALUE start_sequence(
295
312
  }
296
313
  #endif
297
314
 
298
- Data_Get_Struct(self, yaml_emitter_t, emitter);
315
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
299
316
 
300
317
  yaml_sequence_start_event_initialize(
301
318
  &event,
@@ -320,7 +337,7 @@ static VALUE end_sequence(VALUE self)
320
337
  {
321
338
  yaml_emitter_t * emitter;
322
339
  yaml_event_t event;
323
- Data_Get_Struct(self, yaml_emitter_t, emitter);
340
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
324
341
 
325
342
  yaml_sequence_end_event_initialize(&event);
326
343
 
@@ -348,7 +365,7 @@ static VALUE start_mapping(
348
365
  #ifdef HAVE_RUBY_ENCODING_H
349
366
  rb_encoding *encoding;
350
367
  #endif
351
- Data_Get_Struct(self, yaml_emitter_t, emitter);
368
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
352
369
 
353
370
  #ifdef HAVE_RUBY_ENCODING_H
354
371
  encoding = rb_utf8_encoding();
@@ -387,7 +404,7 @@ static VALUE end_mapping(VALUE self)
387
404
  {
388
405
  yaml_emitter_t * emitter;
389
406
  yaml_event_t event;
390
- Data_Get_Struct(self, yaml_emitter_t, emitter);
407
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
391
408
 
392
409
  yaml_mapping_end_event_initialize(&event);
393
410
 
@@ -406,7 +423,7 @@ static VALUE alias(VALUE self, VALUE anchor)
406
423
  {
407
424
  yaml_emitter_t * emitter;
408
425
  yaml_event_t event;
409
- Data_Get_Struct(self, yaml_emitter_t, emitter);
426
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
410
427
 
411
428
  #ifdef HAVE_RUBY_ENCODING_H
412
429
  if(!NIL_P(anchor)) {
@@ -432,7 +449,7 @@ static VALUE alias(VALUE self, VALUE anchor)
432
449
  static VALUE set_canonical(VALUE self, VALUE style)
433
450
  {
434
451
  yaml_emitter_t * emitter;
435
- Data_Get_Struct(self, yaml_emitter_t, emitter);
452
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
436
453
 
437
454
  yaml_emitter_set_canonical(emitter, Qtrue == style ? 1 : 0);
438
455
 
@@ -446,7 +463,7 @@ static VALUE set_canonical(VALUE self, VALUE style)
446
463
  static VALUE canonical(VALUE self)
447
464
  {
448
465
  yaml_emitter_t * emitter;
449
- Data_Get_Struct(self, yaml_emitter_t, emitter);
466
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
450
467
 
451
468
  return (emitter->canonical == 0) ? Qfalse : Qtrue;
452
469
  }
@@ -459,7 +476,7 @@ static VALUE canonical(VALUE self)
459
476
  static VALUE set_indentation(VALUE self, VALUE level)
460
477
  {
461
478
  yaml_emitter_t * emitter;
462
- Data_Get_Struct(self, yaml_emitter_t, emitter);
479
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
463
480
 
464
481
  yaml_emitter_set_indent(emitter, NUM2INT(level));
465
482
 
@@ -473,7 +490,7 @@ static VALUE set_indentation(VALUE self, VALUE level)
473
490
  static VALUE indentation(VALUE self)
474
491
  {
475
492
  yaml_emitter_t * emitter;
476
- Data_Get_Struct(self, yaml_emitter_t, emitter);
493
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
477
494
 
478
495
  return INT2NUM(emitter->best_indent);
479
496
  }
@@ -485,7 +502,7 @@ static VALUE indentation(VALUE self)
485
502
  static VALUE line_width(VALUE self)
486
503
  {
487
504
  yaml_emitter_t * emitter;
488
- Data_Get_Struct(self, yaml_emitter_t, emitter);
505
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
489
506
 
490
507
  return INT2NUM(emitter->best_width);
491
508
  }
@@ -497,14 +514,14 @@ static VALUE line_width(VALUE self)
497
514
  static VALUE set_line_width(VALUE self, VALUE width)
498
515
  {
499
516
  yaml_emitter_t * emitter;
500
- Data_Get_Struct(self, yaml_emitter_t, emitter);
517
+ TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
501
518
 
502
519
  yaml_emitter_set_width(emitter, NUM2INT(width));
503
520
 
504
521
  return width;
505
522
  }
506
523
 
507
- void Init_psych_emitter()
524
+ void Init_psych_emitter(void)
508
525
  {
509
526
  VALUE psych = rb_define_module("Psych");
510
527
  VALUE handler = rb_define_class_under(psych, "Handler", rb_cObject);
@@ -3,6 +3,6 @@
3
3
 
4
4
  #include <psych.h>
5
5
 
6
- void Init_psych_emitter();
6
+ void Init_psych_emitter(void);
7
7
 
8
8
  #endif
@@ -49,14 +49,32 @@ static void dealloc(void * ptr)
49
49
  xfree(parser);
50
50
  }
51
51
 
52
+ #if 0
53
+ static size_t memsize(const void *ptr)
54
+ {
55
+ const yaml_parser_t *parser = ptr;
56
+ /* TODO: calculate parser's size */
57
+ return 0;
58
+ }
59
+ #endif
60
+
61
+ static const rb_data_type_t psych_parser_type = {
62
+ "Psych/parser",
63
+ {0, dealloc, 0,},
64
+ 0, 0,
65
+ #ifdef RUBY_TYPED_FREE_IMMEDIATELY
66
+ RUBY_TYPED_FREE_IMMEDIATELY,
67
+ #endif
68
+ };
69
+
52
70
  static VALUE allocate(VALUE klass)
53
71
  {
54
72
  yaml_parser_t * parser;
73
+ VALUE obj = TypedData_Make_Struct(klass, yaml_parser_t, &psych_parser_type, parser);
55
74
 
56
- parser = xmalloc(sizeof(yaml_parser_t));
57
75
  yaml_parser_initialize(parser);
58
76
 
59
- return Data_Wrap_Struct(klass, 0, dealloc, parser);
77
+ return obj;
60
78
  }
61
79
 
62
80
  static VALUE make_exception(yaml_parser_t * parser, VALUE path)
@@ -248,7 +266,7 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
248
266
  path = rb_str_new2("<unknown>");
249
267
  }
250
268
 
251
- Data_Get_Struct(self, yaml_parser_t, parser);
269
+ TypedData_Get_Struct(self, yaml_parser_t, &psych_parser_type, parser);
252
270
 
253
271
  yaml_parser_delete(parser);
254
272
  yaml_parser_initialize(parser);
@@ -526,7 +544,7 @@ static VALUE mark(VALUE self)
526
544
  VALUE args[3];
527
545
  yaml_parser_t * parser;
528
546
 
529
- Data_Get_Struct(self, yaml_parser_t, parser);
547
+ TypedData_Get_Struct(self, yaml_parser_t, &psych_parser_type, parser);
530
548
  mark_klass = rb_const_get_at(cPsychParser, rb_intern("Mark"));
531
549
  args[0] = INT2NUM(parser->mark.index);
532
550
  args[1] = INT2NUM(parser->mark.line);
@@ -535,7 +553,7 @@ static VALUE mark(VALUE self)
535
553
  return rb_class_new_instance(3, args, mark_klass);
536
554
  }
537
555
 
538
- void Init_psych_parser()
556
+ void Init_psych_parser(void)
539
557
  {
540
558
  #if 0
541
559
  mPsych = rb_define_module("Psych");
@@ -1,6 +1,6 @@
1
1
  #ifndef PSYCH_PARSER_H
2
2
  #define PSYCH_PARSER_H
3
3
 
4
- void Init_psych_parser();
4
+ void Init_psych_parser(void);
5
5
 
6
6
  #endif
@@ -1105,13 +1105,6 @@ yaml_parser_save_simple_key(yaml_parser_t *parser)
1105
1105
  int required = (!parser->flow_level
1106
1106
  && parser->indent == (ptrdiff_t)parser->mark.column);
1107
1107
 
1108
- /*
1109
- * A simple key is required only when it is the first token in the current
1110
- * line. Therefore it is always allowed. But we add a check anyway.
1111
- */
1112
-
1113
- assert(parser->simple_key_allowed || !required); /* Impossible. */
1114
-
1115
1108
  /*
1116
1109
  * If the current position may start a simple key, save it.
1117
1110
  */
@@ -21,7 +21,7 @@ require 'psych/class_loader'
21
21
  #
22
22
  # Psych is a YAML parser and emitter.
23
23
  # Psych leverages libyaml [Home page: http://pyyaml.org/wiki/LibYAML]
24
- # or [Git repo: https://github.com/zerotao/libyaml] for its YAML parsing
24
+ # or [HG repo: https://bitbucket.org/xi/libyaml] for its YAML parsing
25
25
  # and emitting capabilities. In addition to wrapping libyaml, Psych also
26
26
  # knows how to serialize and de-serialize most Ruby objects to and from
27
27
  # the YAML format.
@@ -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.5'
220
+ VERSION = '2.0.13'
221
221
 
222
222
  # The version of libyaml Psych is using
223
223
  LIBYAML_VERSION = Psych.libyaml_version.join '.'