psych 5.3.1-java → 5.4.0-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c01e7b2c370463f0783928d5a13740337785a8a58e11a2a3407ce51afeeceb3b
4
- data.tar.gz: c93b1093d351635dae91ca73cfbc1d6cdaee79fa330777e3be3fef3811d5c5bd
3
+ metadata.gz: e62755a6f6b0b7f7eebe2651fbb2b1c81538e2bcbc1d010fe58574b7ede21b84
4
+ data.tar.gz: 39bc8e482405345038582fb548d6164bdcea116424786c508be42f25753567e8
5
5
  SHA512:
6
- metadata.gz: a80ac65aa0077cebd8cd49692ad2d51d3204b9a0347ec4fe37b6156efe9fa00e829e807a3caafd37123009ad950cc4489f8cdba00d9c248e5506d4cb3daa67eb
7
- data.tar.gz: 3106c06018cce99dea63e8c63917c30a1a313d956b03e4d339e6f59f08fd020adcafe188df67effc667e3ef1850684df0862f079ea73eb22660ec2ebde86589e
6
+ metadata.gz: d2fcda255f004e0fa53379d5192acf1e77b0cb5f8af431495acda6291fd818a2089569d4e840aca9920ad3a70d92d2eb4af2fe4e98e957410a08f4c3b94ab990
7
+ data.tar.gz: dc0f517aa6da6eaf7fe614229069d01c34edc3b29da6056e613a66f7cd33034599e1b3d761d4c1ea879d1c1e8ad92df5f5489ef7b242f6fff56723d6b6cc3259
data/README.md CHANGED
@@ -26,8 +26,8 @@ Psych.dump("foo") # => "--- foo\n...\n"
26
26
 
27
27
  ## Installation
28
28
 
29
- Psych has been included with MRI since 1.9.2, and is the default YAML parser
30
- in 1.9.3.
29
+ Psych has been included with MRI since 1.9.2, and has been the default YAML parser
30
+ since 1.9.3.
31
31
 
32
32
  If you want a newer gem release of Psych, you can use RubyGems:
33
33
 
@@ -32,9 +32,20 @@ static int io_reader(void * data, unsigned char *buf, size_t size, size_t *read)
32
32
  *read = 0;
33
33
 
34
34
  if(! NIL_P(string)) {
35
- void * str = (void *)StringValuePtr(string);
36
- *read = (size_t)RSTRING_LEN(string);
37
- memcpy(buf, str, *read);
35
+ char * str = StringValuePtr(string);
36
+ size_t len = (size_t)RSTRING_LEN(string);
37
+
38
+ /* IO#read(size) is documented to return at most `size` bytes, but a
39
+ * misbehaving IO-like object may return more. Clamp the copy to the
40
+ * buffer libyaml gave us to avoid writing past its end, rounding down
41
+ * to a character boundary so a multibyte character is never split. */
42
+ if(len > size) {
43
+ rb_encoding * enc = rb_enc_get(string);
44
+ len = (size_t)(rb_enc_left_char_head(str, str + size, str + len, enc) - str);
45
+ }
46
+
47
+ *read = len;
48
+ memcpy(buf, str, len);
38
49
  }
39
50
 
40
51
  return 1;
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Psych
4
4
  # The version of Psych you are using
5
- VERSION = '5.3.1'
5
+ VERSION = '5.4.0'
6
6
 
7
7
  if RUBY_ENGINE == 'jruby'
8
8
  DEFAULT_SNAKEYAML_VERSION = '2.10'.freeze
data/lib/psych.jar CHANGED
Binary file
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: 5.3.1
4
+ version: 5.4.0
5
5
  platform: java
6
6
  authors:
7
7
  - Aaron Patterson
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements:
135
135
  - jar org.snakeyaml:snakeyaml-engine, 2.10
136
- rubygems_version: 4.0.2
136
+ rubygems_version: 4.0.3
137
137
  specification_version: 4
138
138
  summary: Psych is a YAML parser and emitter
139
139
  test_files: []