psych 2.1.1-java → 2.2.0-java

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: 8645c7bd38a6dbc8c7b287fc65e9bfd18b2658fe
4
- data.tar.gz: 13e09c0edcdea89dd682f1370dbd1642684d2a59
3
+ metadata.gz: e9a566d67577254a64f85aa32698fc9130696a6c
4
+ data.tar.gz: 3ed7b3a1c81f659cc23c60e498d5865f786ec2c1
5
5
  SHA512:
6
- metadata.gz: b37a81b39236778d2fc23d53aef025f90449638f486c9bb72eae2dd7d05f5366bcac94c8596d8638e2394de2ae217ed15ffe0b84b98e858a7415e09a0ead6969
7
- data.tar.gz: 75826880b51eeac52e0cb5eee62f931e4931bffc548aad3b12ed5798d5ab18c6e5e7a62d6ca8849db687efaf2058f9d7cd296f80f030850329bd50e95b52a3ec
6
+ metadata.gz: e953bb9160c2b233574b76cdc1e43a173a7ae2521d5b90b8a06374e8dab06916873629c7933122f53d5bc65d0cd9b9de0af543e6b12dfa2f2ea3b9dcd332d7a2
7
+ data.tar.gz: 6f367747956322a2a82edf788369d0d8deb3de61f9b4930aba2313248137f726198489c894002fa03dd151c227735e3bc801fc31b0dfc4f381266fb3b862f5b6
@@ -0,0 +1,73 @@
1
+ # Psych
2
+
3
+ [![Build Status](https://travis-ci.org/ruby/psych.svg?branch=master)](https://travis-ci.org/ruby/psych)
4
+ [![Build status](https://ci.appveyor.com/api/projects/status/2t6x109xfmbx209k/branch/master?svg=true)](https://ci.appveyor.com/project/ruby/psych/branch/master)
5
+
6
+ * https://github.com/ruby/psych
7
+
8
+ ## Description
9
+
10
+ Psych is a YAML parser and emitter. Psych leverages
11
+ [libyaml](http://pyyaml.org/wiki/LibYAML) for its YAML parsing and emitting
12
+ capabilities. In addition to wrapping libyaml, Psych also knows how to
13
+ serialize and de-serialize most Ruby objects to and from the YAML format.
14
+
15
+ ## Examples
16
+
17
+ # Load YAML in to a Ruby object
18
+ Psych.load('--- foo') # => 'foo'
19
+
20
+ # Emit YAML from a Ruby object
21
+ Psych.dump("foo") # => "--- foo\n...\n"
22
+
23
+ ## Dependencies
24
+
25
+ * libyaml
26
+
27
+ ## Installation
28
+
29
+ Psych has been included with MRI since 1.9.2, and is the default YAML parser
30
+ in 1.9.3.
31
+
32
+ If you want a newer gem release of Psych, you can use rubygems:
33
+
34
+ gem install psych
35
+
36
+ In order to use the gem release in your app, and not the stdlib version,
37
+ you'll need the following:
38
+
39
+ gem 'psych'
40
+ require 'psych'
41
+
42
+ Or if you use Bundler add this to your `Gemfile`:
43
+
44
+ gem 'psych'
45
+
46
+ JRuby ships with a pure Java implementation of Psych.
47
+
48
+ If you're on Rubinius, Psych is available in 1.9 mode, please refer to the
49
+ Language Modes section of the [Rubinius
50
+ README](https://github.com/rubinius/rubinius#readme) for more information on
51
+ building and 1.9 mode.
52
+
53
+ ## License
54
+
55
+ Copyright 2009 Aaron Patterson, et al.
56
+
57
+ Permission is hereby granted, free of charge, to any person obtaining a copy
58
+ of this software and associated documentation files (the 'Software'), to deal
59
+ in the Software without restriction, including without limitation the rights
60
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
61
+ copies of the Software, and to permit persons to whom the Software is
62
+ furnished to do so, subject to the following conditions:
63
+
64
+ The above copyright notice and this permission notice shall be included in all
65
+ copies or substantial portions of the Software.
66
+
67
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
68
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
69
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
70
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
71
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
72
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
73
+ SOFTWARE.
@@ -77,7 +77,7 @@ import org.jruby.util.ByteList;
77
77
 
78
78
  public class PsychParser extends RubyObject {
79
79
 
80
- private static final Logger LOG = LoggerFactory.getLogger("PsychParser");
80
+ private static final Logger LOG = LoggerFactory.getLogger(PsychParser.class);
81
81
 
82
82
  public static void initPsychParser(Ruby runtime, RubyModule psych) {
83
83
  RubyClass psychParser = runtime.defineClassUnder("Parser", runtime.getObject(), new ObjectAllocator() {
@@ -55,7 +55,7 @@ public class PsychToRuby {
55
55
  public static IRubyObject build_exception(ThreadContext context, IRubyObject self, IRubyObject klass, IRubyObject message) {
56
56
  if (klass instanceof RubyClass) {
57
57
  IRubyObject exception = ((RubyClass)klass).allocate();
58
- ((RubyException)exception).message = message;
58
+ ((RubyException)exception).setMessage(message);
59
59
  return exception;
60
60
  } else {
61
61
  throw context.runtime.newTypeError(klass, context.runtime.getClassClass());
@@ -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(emitter, emitter->tag_directives)) {
398
+ while (!STACK_EMPTY(empty, 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);
@@ -415,7 +415,7 @@ yaml_string_write_handler(void *data, unsigned char *buffer, size_t size)
415
415
  {
416
416
  yaml_emitter_t *emitter = data;
417
417
 
418
- if (emitter->output.string.size + *emitter->output.string.size_written
418
+ if (emitter->output.string.size - *emitter->output.string.size_written
419
419
  < size) {
420
420
  memcpy(emitter->output.string.buffer
421
421
  + *emitter->output.string.size_written,
@@ -822,7 +822,6 @@ yaml_scalar_event_initialize(yaml_event_t *event,
822
822
  yaml_char_t *anchor_copy = NULL;
823
823
  yaml_char_t *tag_copy = NULL;
824
824
  yaml_char_t *value_copy = NULL;
825
- size_t value_length;
826
825
 
827
826
  assert(event); /* Non-NULL event object is expected. */
828
827
  assert(value); /* Non-NULL anchor is expected. */
@@ -840,19 +839,16 @@ yaml_scalar_event_initialize(yaml_event_t *event,
840
839
  }
841
840
 
842
841
  if (length < 0) {
843
- value_length = strlen((char *)value);
844
- }
845
- else {
846
- value_length = (size_t)length;
842
+ length = strlen((char *)value);
847
843
  }
848
844
 
849
- if (!yaml_check_utf8(value, value_length)) goto error;
850
- value_copy = yaml_malloc(value_length+1);
845
+ if (!yaml_check_utf8(value, length)) goto error;
846
+ value_copy = yaml_malloc(length+1);
851
847
  if (!value_copy) goto error;
852
- memcpy(value_copy, value, value_length);
853
- value_copy[value_length] = '\0';
848
+ memcpy(value_copy, value, length);
849
+ value_copy[length] = '\0';
854
850
 
855
- SCALAR_EVENT_INIT(*event, anchor_copy, tag_copy, value_copy, value_length,
851
+ SCALAR_EVENT_INIT(*event, anchor_copy, tag_copy, value_copy, length,
856
852
  plain_implicit, quoted_implicit, style, mark, mark);
857
853
 
858
854
  return 1;
@@ -1206,8 +1202,6 @@ yaml_document_add_scalar(yaml_document_t *document,
1206
1202
  yaml_char_t *tag_copy = NULL;
1207
1203
  yaml_char_t *value_copy = NULL;
1208
1204
  yaml_node_t node;
1209
- size_t value_length;
1210
- ptrdiff_t ret;
1211
1205
 
1212
1206
  assert(document); /* Non-NULL document object is expected. */
1213
1207
  assert(value); /* Non-NULL value is expected. */
@@ -1221,26 +1215,19 @@ yaml_document_add_scalar(yaml_document_t *document,
1221
1215
  if (!tag_copy) goto error;
1222
1216
 
1223
1217
  if (length < 0) {
1224
- value_length = strlen((char *)value);
1225
- }
1226
- else {
1227
- value_length = (size_t)length;
1218
+ length = strlen((char *)value);
1228
1219
  }
1229
1220
 
1230
- if (!yaml_check_utf8(value, value_length)) goto error;
1231
- value_copy = yaml_malloc(value_length+1);
1221
+ if (!yaml_check_utf8(value, length)) goto error;
1222
+ value_copy = yaml_malloc(length+1);
1232
1223
  if (!value_copy) goto error;
1233
- memcpy(value_copy, value, value_length);
1234
- value_copy[value_length] = '\0';
1224
+ memcpy(value_copy, value, length);
1225
+ value_copy[length] = '\0';
1235
1226
 
1236
- SCALAR_NODE_INIT(node, tag_copy, value_copy, value_length, style, mark, mark);
1227
+ SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark);
1237
1228
  if (!PUSH(&context, document->nodes, node)) goto error;
1238
1229
 
1239
- ret = document->nodes.top - document->nodes.start;
1240
- #if PTRDIFF_MAX > INT_MAX
1241
- if (ret > INT_MAX) goto error;
1242
- #endif
1243
- return (int)ret;
1230
+ return document->nodes.top - document->nodes.start;
1244
1231
 
1245
1232
  error:
1246
1233
  yaml_free(tag_copy);
@@ -1268,7 +1255,6 @@ yaml_document_add_sequence(yaml_document_t *document,
1268
1255
  yaml_node_item_t *top;
1269
1256
  } items = { NULL, NULL, NULL };
1270
1257
  yaml_node_t node;
1271
- ptrdiff_t ret;
1272
1258
 
1273
1259
  assert(document); /* Non-NULL document object is expected. */
1274
1260
 
@@ -1286,11 +1272,7 @@ yaml_document_add_sequence(yaml_document_t *document,
1286
1272
  style, mark, mark);
1287
1273
  if (!PUSH(&context, document->nodes, node)) goto error;
1288
1274
 
1289
- ret = document->nodes.top - document->nodes.start;
1290
- #if PTRDIFF_MAX > INT_MAX
1291
- if (ret > INT_MAX) goto error;
1292
- #endif
1293
- return (int)ret;
1275
+ return document->nodes.top - document->nodes.start;
1294
1276
 
1295
1277
  error:
1296
1278
  STACK_DEL(&context, items);
@@ -1318,7 +1300,6 @@ yaml_document_add_mapping(yaml_document_t *document,
1318
1300
  yaml_node_pair_t *top;
1319
1301
  } pairs = { NULL, NULL, NULL };
1320
1302
  yaml_node_t node;
1321
- ptrdiff_t ret;
1322
1303
 
1323
1304
  assert(document); /* Non-NULL document object is expected. */
1324
1305
 
@@ -1336,11 +1317,7 @@ yaml_document_add_mapping(yaml_document_t *document,
1336
1317
  style, mark, mark);
1337
1318
  if (!PUSH(&context, document->nodes, node)) goto error;
1338
1319
 
1339
- ret = document->nodes.top - document->nodes.start;
1340
- #if PTRDIFF_MAX > INT_MAX
1341
- if (ret > INT_MAX) goto error;
1342
- #endif
1343
- return (int)ret;
1320
+ return document->nodes.top - document->nodes.start;
1344
1321
 
1345
1322
  error:
1346
1323
  STACK_DEL(&context, pairs);
@@ -1,10 +1,10 @@
1
1
  #define PACKAGE_NAME "yaml"
2
2
  #define PACKAGE_TARNAME "yaml"
3
- #define PACKAGE_VERSION "0.1.6"
4
- #define PACKAGE_STRING "yaml 0.1.6"
5
- #define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component libyaml"
6
- #define PACKAGE_URL ""
3
+ #define PACKAGE_VERSION "0.1.7"
4
+ #define PACKAGE_STRING "yaml 0.1.7"
5
+ #define PACKAGE_BUGREPORT "https://github.com/yaml/libyaml/issues"
6
+ #define PACKAGE_URL "https://github.com/yaml/libyaml"
7
7
  #define YAML_VERSION_MAJOR 0
8
8
  #define YAML_VERSION_MINOR 1
9
- #define YAML_VERSION_PATCH 6
10
- #define YAML_VERSION_STRING "0.1.6"
9
+ #define YAML_VERSION_PATCH 7
10
+ #define YAML_VERSION_STRING "0.1.7"
@@ -53,7 +53,7 @@
53
53
  #define WRITE_BREAK(emitter,string) \
54
54
  (FLUSH(emitter) \
55
55
  && (CHECK(string,'\n') ? \
56
- ((void)PUT_BREAK(emitter), \
56
+ (PUT_BREAK(emitter), \
57
57
  string.pointer ++, \
58
58
  1) : \
59
59
  (COPY(emitter->buffer,string), \
@@ -221,7 +221,7 @@ yaml_emitter_write_indent(yaml_emitter_t *emitter);
221
221
 
222
222
  static int
223
223
  yaml_emitter_write_indicator(yaml_emitter_t *emitter,
224
- const char *indicator, int need_whitespace,
224
+ char *indicator, int need_whitespace,
225
225
  int is_whitespace, int is_indention);
226
226
 
227
227
  static int
@@ -517,7 +517,7 @@ yaml_emitter_emit_stream_start(yaml_emitter_t *emitter,
517
517
  if (emitter->best_width < 0) {
518
518
  emitter->best_width = INT_MAX;
519
519
  }
520
-
520
+
521
521
  if (!emitter->line_break) {
522
522
  emitter->line_break = YAML_LN_BREAK;
523
523
  }
@@ -607,7 +607,7 @@ yaml_emitter_emit_document_start(yaml_emitter_t *emitter,
607
607
  if (!yaml_emitter_write_indent(emitter))
608
608
  return 0;
609
609
  }
610
-
610
+
611
611
  if (event->data.document_start.tag_directives.start
612
612
  != event->data.document_start.tag_directives.end) {
613
613
  implicit = 0;
@@ -721,7 +721,7 @@ yaml_emitter_emit_document_end(yaml_emitter_t *emitter,
721
721
  }
722
722
 
723
723
  /*
724
- *
724
+ *
725
725
  * Expect a flow item node.
726
726
  */
727
727
 
@@ -1402,7 +1402,7 @@ yaml_emitter_analyze_anchor(yaml_emitter_t *emitter,
1402
1402
  {
1403
1403
  size_t anchor_length;
1404
1404
  yaml_string_t string;
1405
-
1405
+
1406
1406
  anchor_length = strlen((char *)anchor);
1407
1407
  STRING_ASSIGN(string, anchor, anchor_length);
1408
1408
 
@@ -1784,7 +1784,7 @@ yaml_emitter_write_indent(yaml_emitter_t *emitter)
1784
1784
 
1785
1785
  static int
1786
1786
  yaml_emitter_write_indicator(yaml_emitter_t *emitter,
1787
- const char *indicator, int need_whitespace,
1787
+ char *indicator, int need_whitespace,
1788
1788
  int is_whitespace, int is_indention)
1789
1789
  {
1790
1790
  size_t indicator_length;
@@ -2178,7 +2178,7 @@ yaml_emitter_write_block_scalar_hints(yaml_emitter_t *emitter,
2178
2178
  yaml_string_t string)
2179
2179
  {
2180
2180
  char indent_hint[2];
2181
- const char *chomp_hint = NULL;
2181
+ char *chomp_hint = NULL;
2182
2182
 
2183
2183
  if (IS_SPACE(string) || IS_BREAK(string))
2184
2184
  {
@@ -283,7 +283,6 @@ static int
283
283
  yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event)
284
284
  {
285
285
  yaml_node_t node;
286
- ptrdiff_t node_index;
287
286
  int index;
288
287
  yaml_char_t *tag = first_event->data.scalar.tag;
289
288
 
@@ -301,11 +300,7 @@ yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event)
301
300
 
302
301
  if (!PUSH(parser, parser->document->nodes, node)) goto error;
303
302
 
304
- node_index = parser->document->nodes.top - parser->document->nodes.start;
305
- #if PTRDIFF_MAX > INT_MAX
306
- if (node_index > INT_MAX) goto error;
307
- #endif
308
- index = (int)node_index;
303
+ index = parser->document->nodes.top - parser->document->nodes.start;
309
304
 
310
305
  if (!yaml_parser_register_anchor(parser, index,
311
306
  first_event->data.scalar.anchor)) return 0;
@@ -334,7 +329,6 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
334
329
  yaml_node_item_t *top;
335
330
  } items = { NULL, NULL, NULL };
336
331
  int index, item_index;
337
- ptrdiff_t node_index;
338
332
  yaml_char_t *tag = first_event->data.sequence_start.tag;
339
333
 
340
334
  if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error;
@@ -353,11 +347,7 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
353
347
 
354
348
  if (!PUSH(parser, parser->document->nodes, node)) goto error;
355
349
 
356
- node_index = parser->document->nodes.top - parser->document->nodes.start;
357
- #if PTRDIFF_MAX > INT_MAX
358
- if (node_index > INT_MAX) goto error;
359
- #endif
360
- index = (int)node_index;
350
+ index = parser->document->nodes.top - parser->document->nodes.start;
361
351
 
362
352
  if (!yaml_parser_register_anchor(parser, index,
363
353
  first_event->data.sequence_start.anchor)) return 0;
@@ -401,7 +391,6 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
401
391
  yaml_node_pair_t *top;
402
392
  } pairs = { NULL, NULL, NULL };
403
393
  int index;
404
- ptrdiff_t node_index;
405
394
  yaml_node_pair_t pair;
406
395
  yaml_char_t *tag = first_event->data.mapping_start.tag;
407
396
 
@@ -421,11 +410,7 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
421
410
 
422
411
  if (!PUSH(parser, parser->document->nodes, node)) goto error;
423
412
 
424
- node_index = parser->document->nodes.top - parser->document->nodes.start;
425
- #if PTRDIFF_MAX > INT_MAX
426
- if (node_index > INT_MAX) goto error;
427
- #endif
428
- index = (int)node_index;
413
+ index = parser->document->nodes.top - parser->document->nodes.start;
429
414
 
430
415
  if (!yaml_parser_register_anchor(parser, index,
431
416
  first_event->data.mapping_start.anchor)) return 0;
@@ -759,8 +759,9 @@ 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. */
762
763
  parser->state = POP(parser, parser->states);
763
- (void)POP(parser, parser->marks);
764
+ dummy_mark = POP(parser, parser->marks);
764
765
  SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
765
766
  SKIP_TOKEN(parser);
766
767
  return 1;
@@ -868,8 +869,9 @@ yaml_parser_parse_block_mapping_key(yaml_parser_t *parser,
868
869
 
869
870
  else if (token->type == YAML_BLOCK_END_TOKEN)
870
871
  {
872
+ yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
871
873
  parser->state = POP(parser, parser->states);
872
- (void)POP(parser, parser->marks);
874
+ dummy_mark = POP(parser, parser->marks);
873
875
  MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
874
876
  SKIP_TOKEN(parser);
875
877
  return 1;
@@ -950,6 +952,7 @@ yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser,
950
952
  yaml_event_t *event, int first)
951
953
  {
952
954
  yaml_token_t *token;
955
+ yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
953
956
 
954
957
  if (first) {
955
958
  token = PEEK_TOKEN(parser);
@@ -994,7 +997,7 @@ yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser,
994
997
  }
995
998
 
996
999
  parser->state = POP(parser, parser->states);
997
- (void)POP(parser, parser->marks);
1000
+ dummy_mark = POP(parser, parser->marks);
998
1001
  SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
999
1002
  SKIP_TOKEN(parser);
1000
1003
  return 1;
@@ -1101,6 +1104,7 @@ yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser,
1101
1104
  yaml_event_t *event, int first)
1102
1105
  {
1103
1106
  yaml_token_t *token;
1107
+ yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
1104
1108
 
1105
1109
  if (first) {
1106
1110
  token = PEEK_TOKEN(parser);
@@ -1154,7 +1158,7 @@ yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser,
1154
1158
  }
1155
1159
 
1156
1160
  parser->state = POP(parser, parser->states);
1157
- (void)POP(parser, parser->marks);
1161
+ dummy_mark = POP(parser, parser->marks);
1158
1162
  MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
1159
1163
  SKIP_TOKEN(parser);
1160
1164
  return 1;
@@ -1291,7 +1295,7 @@ yaml_parser_process_directives(yaml_parser_t *parser,
1291
1295
  token = PEEK_TOKEN(parser);
1292
1296
  if (!token) goto error;
1293
1297
  }
1294
-
1298
+
1295
1299
  for (default_tag_directive = default_tag_directives;
1296
1300
  default_tag_directive->handle; default_tag_directive++) {
1297
1301
  if (!yaml_parser_append_tag_directive(parser, *default_tag_directive, 1,
@@ -52,7 +52,7 @@ yaml_parser_determine_encoding(yaml_parser_t *parser)
52
52
  {
53
53
  /* Ensure that we had enough bytes in the raw buffer. */
54
54
 
55
- while (!parser->eof
55
+ while (!parser->eof
56
56
  && parser->raw_buffer.last - parser->raw_buffer.pointer < 3) {
57
57
  if (!yaml_parser_update_raw_buffer(parser)) {
58
58
  return 0;
@@ -295,7 +295,7 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
295
295
  parser->offset, value);
296
296
 
297
297
  break;
298
-
298
+
299
299
  case YAML_UTF16LE_ENCODING:
300
300
  case YAML_UTF16BE_ENCODING:
301
301
 
@@ -318,7 +318,7 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
318
318
  *
319
319
  * The following formulas are used for decoding
320
320
  * and encoding characters using surrogate pairs:
321
- *
321
+ *
322
322
  * U = U' + 0x10000 (0x01 00 00 <= U <= 0x10 FF FF)
323
323
  * U' = yyyyyyyyyyxxxxxxxxxx (0 <= U' <= 0x0F FF FF)
324
324
  * W1 = 110110yyyyyyyyyy
@@ -70,7 +70,7 @@
70
70
  * %TAG !yaml! tag:yaml.org,2002:
71
71
  * ---
72
72
  *
73
- * The corresponding sequence of tokens:
73
+ * The correspoding sequence of tokens:
74
74
  *
75
75
  * STREAM-START(utf-8)
76
76
  * VERSION-DIRECTIVE(1,1)
@@ -762,7 +762,7 @@ yaml_parser_scan(yaml_parser_t *parser, yaml_token_t *token)
762
762
  }
763
763
 
764
764
  /* Fetch the next token from the queue. */
765
-
765
+
766
766
  *token = DEQUEUE(parser, parser->tokens);
767
767
  parser->token_available = 0;
768
768
  parser->tokens_parsed ++;
@@ -1114,7 +1114,7 @@ yaml_parser_save_simple_key(yaml_parser_t *parser)
1114
1114
  yaml_simple_key_t simple_key;
1115
1115
  simple_key.possible = 1;
1116
1116
  simple_key.required = required;
1117
- simple_key.token_number =
1117
+ simple_key.token_number =
1118
1118
  parser->tokens_parsed + (parser->tokens.tail - parser->tokens.head);
1119
1119
  simple_key.mark = parser->mark;
1120
1120
 
@@ -1186,9 +1186,11 @@ yaml_parser_increase_flow_level(yaml_parser_t *parser)
1186
1186
  static int
1187
1187
  yaml_parser_decrease_flow_level(yaml_parser_t *parser)
1188
1188
  {
1189
+ yaml_simple_key_t dummy_key; /* Used to eliminate a compiler warning. */
1190
+
1189
1191
  if (parser->flow_level) {
1190
1192
  parser->flow_level --;
1191
- (void)POP(parser, parser->simple_keys);
1193
+ dummy_key = POP(parser, parser->simple_keys);
1192
1194
  }
1193
1195
 
1194
1196
  return 1;
@@ -1198,7 +1200,7 @@ yaml_parser_decrease_flow_level(yaml_parser_t *parser)
1198
1200
  * Push the current indentation level to the stack and set the new level
1199
1201
  * the current column is greater than the indentation level. In this case,
1200
1202
  * append or insert the specified token into the token queue.
1201
- *
1203
+ *
1202
1204
  */
1203
1205
 
1204
1206
  static int
@@ -1222,14 +1224,12 @@ yaml_parser_roll_indent(yaml_parser_t *parser, ptrdiff_t column,
1222
1224
  if (!PUSH(parser, parser->indents, parser->indent))
1223
1225
  return 0;
1224
1226
 
1225
- #if PTRDIFF_MAX > INT_MAX
1226
1227
  if (column > INT_MAX) {
1227
1228
  parser->error = YAML_MEMORY_ERROR;
1228
1229
  return 0;
1229
1230
  }
1230
- #endif
1231
1231
 
1232
- parser->indent = (int)column;
1232
+ parser->indent = column;
1233
1233
 
1234
1234
  /* Create a token and insert it into the queue. */
1235
1235
 
@@ -1938,7 +1938,7 @@ yaml_parser_scan_to_next_token(yaml_parser_t *parser)
1938
1938
  *
1939
1939
  * - in the flow context;
1940
1940
  * - in the block context, but not at the beginning of the line or
1941
- * after '-', '?', or ':' (complex value).
1941
+ * after '-', '?', or ':' (complex value).
1942
1942
  */
1943
1943
 
1944
1944
  if (!CACHE(parser, 1)) return 0;
@@ -3007,7 +3007,7 @@ yaml_parser_scan_block_scalar_breaks(yaml_parser_t *parser,
3007
3007
  *indent = 1;
3008
3008
  }
3009
3009
 
3010
- return 1;
3010
+ return 1;
3011
3011
  }
3012
3012
 
3013
3013
  /*
@@ -74,7 +74,7 @@ yaml_emitter_flush(yaml_emitter_t *emitter)
74
74
  unsigned int value;
75
75
  size_t k;
76
76
 
77
- /*
77
+ /*
78
78
  * See the "reader.c" code for more details on UTF-8 encoding. Note
79
79
  * that we assume that the buffer contains a valid UTF-8 sequence.
80
80
  */
@@ -436,8 +436,7 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
436
436
  (stack).start = (stack).top = (stack).end = 0)
437
437
 
438
438
  #define STACK_EMPTY(context,stack) \
439
- ((void)(context), \
440
- ((stack).start == (stack).top))
439
+ ((stack).start == (stack).top)
441
440
 
442
441
  #define STACK_LIMIT(context,stack,size) \
443
442
  ((stack).top - (stack).start < (size) ? \
@@ -661,4 +660,3 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
661
660
  (node).data.mapping.pairs.end = (node_pairs_end), \
662
661
  (node).data.mapping.pairs.top = (node_pairs_start), \
663
662
  (node).data.mapping.style = (node_style))
664
-
@@ -2,30 +2,32 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "psych"
5
- s.version = "2.1.1"
5
+ s.version = "2.2.0"
6
6
  s.authors = ["Aaron Patterson", "SHIBATA Hiroshi"]
7
7
  s.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org"]
8
- s.date = "2016-09-07"
8
+ s.date = "2016-11-14"
9
9
  s.summary = "Psych is a YAML parser and emitter"
10
10
  s.description = <<-DESCRIPTION
11
11
  Psych is a YAML parser and emitter. Psych leverages libyaml[http://pyyaml.org/wiki/LibYAML]
12
12
  for its YAML parsing and emitting capabilities. In addition to wrapping libyaml,
13
13
  Psych also knows how to serialize and de-serialize most Ruby objects to and from the YAML format.
14
14
  DESCRIPTION
15
- s.homepage = "http://github.com/tenderlove/psych"
15
+ s.homepage = "https://github.com/ruby/psych"
16
16
  s.licenses = ["MIT"]
17
17
  s.require_paths = ["lib"]
18
- s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
18
 
20
- s.rdoc_options = ["--main", "README.rdoc"]
21
- s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.rdoc", "CHANGELOG.rdoc", "README.rdoc"]
19
+ # for ruby core repository. It was generated by `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ s.files = [".gitignore", ".travis.yml", "CHANGELOG.rdoc", "Gemfile", "Mavenfile", "README.md", "Rakefile", "bin/console", "bin/setup", "ext/java/PsychEmitter.java", "ext/java/PsychLibrary.java", "ext/java/PsychParser.java", "ext/java/PsychToRuby.java", "ext/java/PsychYamlTree.java", "ext/psych/.gitignore", "ext/psych/depend", "ext/psych/extconf.rb", "ext/psych/psych.c", "ext/psych/psych.h", "ext/psych/psych_emitter.c", "ext/psych/psych_emitter.h", "ext/psych/psych_parser.c", "ext/psych/psych_parser.h", "ext/psych/psych_to_ruby.c", "ext/psych/psych_to_ruby.h", "ext/psych/psych_yaml_tree.c", "ext/psych/psych_yaml_tree.h", "ext/psych/yaml/LICENSE", "ext/psych/yaml/api.c", "ext/psych/yaml/config.h", "ext/psych/yaml/dumper.c", "ext/psych/yaml/emitter.c", "ext/psych/yaml/loader.c", "ext/psych/yaml/parser.c", "ext/psych/yaml/reader.c", "ext/psych/yaml/scanner.c", "ext/psych/yaml/writer.c", "ext/psych/yaml/yaml.h", "ext/psych/yaml/yaml_private.h", "lib/psych.rb", "lib/psych/class_loader.rb", "lib/psych/coder.rb", "lib/psych/core_ext.rb", "lib/psych/deprecated.rb", "lib/psych/exception.rb", "lib/psych/handler.rb", "lib/psych/handlers/document_stream.rb", "lib/psych/handlers/recorder.rb", "lib/psych/json/ruby_events.rb", "lib/psych/json/stream.rb", "lib/psych/json/tree_builder.rb", "lib/psych/json/yaml_events.rb", "lib/psych/nodes.rb", "lib/psych/nodes/alias.rb", "lib/psych/nodes/document.rb", "lib/psych/nodes/mapping.rb", "lib/psych/nodes/node.rb", "lib/psych/nodes/scalar.rb", "lib/psych/nodes/sequence.rb", "lib/psych/nodes/stream.rb", "lib/psych/omap.rb", "lib/psych/parser.rb", "lib/psych/scalar_scanner.rb", "lib/psych/set.rb", "lib/psych/stream.rb", "lib/psych/streaming.rb", "lib/psych/syntax_error.rb", "lib/psych/tree_builder.rb", "lib/psych/versions.rb", "lib/psych/visitors.rb","lib/psych/visitors/depth_first.rb", "lib/psych/visitors/emitter.rb", "lib/psych/visitors/json_tree.rb", "lib/psych/visitors/to_ruby.rb", "lib/psych/visitors/visitor.rb", "lib/psych/visitors/yaml_tree.rb", "lib/psych/y.rb", "lib/psych_jars.rb", "psych.gemspec"]
21
+
22
+ s.rdoc_options = ["--main", "README.md"]
23
+ s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.md"]
22
24
 
23
25
  s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
24
26
  s.rubygems_version = "2.5.1"
25
27
  s.required_rubygems_version = Gem::Requirement.new(">= 0")
26
28
 
27
- s.add_development_dependency(%q<rake-compiler>, [">= 0.4.1"])
28
- s.add_development_dependency(%q<minitest>, ["~> 5.0"])
29
+ s.add_development_dependency 'rake-compiler', ">= 0.4.1"
30
+ s.add_development_dependency 'minitest', "~> 5.0"
29
31
 
30
32
  if RUBY_PLATFORM =~ /java/
31
33
  require 'psych/versions'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psych
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: java
6
6
  authors:
7
7
  - Aaron Patterson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-07 00:00:00.000000000 Z
12
+ date: 2016-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +78,14 @@ executables: []
78
78
  extensions: []
79
79
  extra_rdoc_files:
80
80
  - CHANGELOG.rdoc
81
- - README.rdoc
81
+ - README.md
82
82
  files:
83
83
  - ".gitignore"
84
84
  - ".travis.yml"
85
85
  - CHANGELOG.rdoc
86
86
  - Gemfile
87
87
  - Mavenfile
88
- - README.rdoc
88
+ - README.md
89
89
  - Rakefile
90
90
  - bin/console
91
91
  - bin/setup
@@ -159,14 +159,14 @@ files:
159
159
  - lib/psych/y.rb
160
160
  - lib/psych_jars.rb
161
161
  - psych.gemspec
162
- homepage: http://github.com/tenderlove/psych
162
+ homepage: https://github.com/ruby/psych
163
163
  licenses:
164
164
  - MIT
165
165
  metadata: {}
166
166
  post_install_message:
167
167
  rdoc_options:
168
168
  - "--main"
169
- - README.rdoc
169
+ - README.md
170
170
  require_paths:
171
171
  - lib
172
172
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -1,71 +0,0 @@
1
- = Psych
2
-
3
- * http://github.com/tenderlove/psych
4
-
5
- == Description
6
-
7
- Psych is a YAML parser and emitter. Psych leverages libyaml[http://pyyaml.org/wiki/LibYAML]
8
- for its YAML parsing and emitting capabilities. In addition to wrapping
9
- libyaml, Psych also knows how to serialize and de-serialize most Ruby objects
10
- to and from the YAML format.
11
-
12
- == Examples
13
-
14
- # Load YAML in to a Ruby object
15
- Psych.load('--- foo') # => 'foo'
16
-
17
- # Emit YAML from a Ruby object
18
- Psych.dump("foo") # => "--- foo\n...\n"
19
-
20
- == Dependencies
21
-
22
- * libyaml
23
-
24
- == Installation
25
-
26
- Psych has been included with MRI since 1.9.2,
27
- and is the default YAML parser in 1.9.3.
28
-
29
- If you want a newer gem release of Psych, you can use rubygems:
30
-
31
- gem install psych
32
-
33
- In order to use the gem release in your app,
34
- and not the stdlib version, you'll need the following:
35
-
36
- gem 'psych'
37
- require 'psych'
38
-
39
- Or if you use Bundler add this to your +Gemfile+:
40
-
41
- gem 'psych'
42
-
43
- JRuby ships with a pure Java implementation of Psych.
44
-
45
- If you're on Rubinius, Psych is available in 1.9 mode, please refer to the
46
- Language Modes section of the {Rubinius
47
- README}[https://github.com/rubinius/rubinius#readme] for more information on
48
- building and 1.9 mode.
49
-
50
- == License
51
-
52
- Copyright 2009 Aaron Patterson, et al.
53
-
54
- Permission is hereby granted, free of charge, to any person obtaining
55
- a copy of this software and associated documentation files (the
56
- 'Software'), to deal in the Software without restriction, including
57
- without limitation the rights to use, copy, modify, merge, publish,
58
- distribute, sublicense, and/or sell copies of the Software, and to
59
- permit persons to whom the Software is furnished to do so, subject to
60
- the following conditions:
61
-
62
- The above copyright notice and this permission notice shall be
63
- included in all copies or substantial portions of the Software.
64
-
65
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
66
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
67
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
68
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
69
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
70
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
71
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.