stringio 3.0.1.2 → 3.0.2.pre1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/ext/stringio/stringio.c +4 -5
  3. metadata +10 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fd11c3537d4a5e971cd74083d1e88ae5e605f6fc3c07ca90311e93693817cb0
4
- data.tar.gz: 32e5d160f233d71d680fab4141ff10e868523ba2dc25556ea5fc242d4d2098de
3
+ metadata.gz: 485b4a853f043d25f1c1a3ece1a7f1e8a1720ee7157bcde9df858ac0f9b61701
4
+ data.tar.gz: f6f24d32282461b5c3b97d1576a7a510def637d0c9dc98834876e5ecbd2792b0
5
5
  SHA512:
6
- metadata.gz: 2f6ef3e51b7871a212dee8fb12be59496fffd6bcf75cb42232798cd5f405647b2a6498b8138cea7fb390110e2d9813021981648557c8ec74850e85ac8094e910
7
- data.tar.gz: 4d0cc8ee35fd2cb1ac0afb0d516a4af004211fd1aa25a919633ba2671dc5a35e48b0fce3bed2a976a413b6a67a90236e0566cb2a1d72a7e76f13c545fa9d6084
6
+ metadata.gz: e2c05da950d38ff21f3b4d4836be02dd7f9c479daff89fb648f84ccfb857a8611bfa2a0ab716f03316887790c70802d83b9a8867705b5aaddbadc9906f23b3a8
7
+ data.tar.gz: c9eb88894bc04413f3ed136b0d5801439913bc9721cf6e8daa5c77cdd118ea2aadab3830d0522949d1147294eda81db09f0e5a43d5ff68d5d49f37c8d305d532
@@ -12,7 +12,7 @@
12
12
 
13
13
  **********************************************************************/
14
14
 
15
- #define STRINGIO_VERSION "3.0.1.2"
15
+ #define STRINGIO_VERSION "3.0.2.pre1"
16
16
 
17
17
  #include "ruby.h"
18
18
  #include "ruby/io.h"
@@ -984,7 +984,7 @@ strio_unget_bytes(struct StringIO *ptr, const char *cp, long cl)
984
984
  len = RSTRING_LEN(str);
985
985
  rest = pos - len;
986
986
  if (cl > pos) {
987
- long ex = cl - (rest < 0 ? pos : len);
987
+ long ex = (rest < 0 ? cl-pos : cl+rest);
988
988
  rb_str_modify_expand(str, ex);
989
989
  rb_str_set_len(str, len + ex);
990
990
  s = RSTRING_PTR(str);
@@ -1233,9 +1233,8 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
1233
1233
  str = strio_substr(ptr, ptr->pos, e - s - w, enc);
1234
1234
  }
1235
1235
  else {
1236
- if (n < e - s + arg->chomp) {
1237
- /* unless chomping, RS at the end does not matter */
1238
- if (e - s < 1024 || n == e - s) {
1236
+ if (n < e - s) {
1237
+ if (e - s < 1024) {
1239
1238
  for (p = s; p + n <= e; ++p) {
1240
1239
  if (MEMCMP(p, RSTRING_PTR(str), char, n) == 0) {
1241
1240
  e = p + (arg->chomp ? 0 : n);
metadata CHANGED
@@ -1,16 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stringio
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1.2
4
+ version: 3.0.2.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobu Nakada
8
+ - Charles Oliver Nutter
9
+ autorequire:
8
10
  bindir: bin
9
11
  cert_chain: []
10
- date: 2024-03-19 00:00:00.000000000 Z
12
+ date: 2022-04-15 00:00:00.000000000 Z
11
13
  dependencies: []
12
14
  description: Pseudo `IO` class from/to `String`.
13
- email: nobu@ruby-lang.org
15
+ email:
16
+ - nobu@ruby-lang.org
17
+ - headius@headius.com
14
18
  executables: []
15
19
  extensions:
16
20
  - ext/stringio/extconf.rb
@@ -24,6 +28,7 @@ licenses:
24
28
  - Ruby
25
29
  - BSD-2-Clause
26
30
  metadata: {}
31
+ post_install_message:
27
32
  rdoc_options: []
28
33
  require_paths:
29
34
  - lib
@@ -38,7 +43,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
38
43
  - !ruby/object:Gem::Version
39
44
  version: '2.6'
40
45
  requirements: []
41
- rubygems_version: 3.6.0.dev
46
+ rubygems_version: 3.3.7
47
+ signing_key:
42
48
  specification_version: 4
43
49
  summary: Pseudo IO on String
44
50
  test_files: []