spring 3.1.0 → 3.1.1

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
  SHA256:
3
- metadata.gz: 4b47e67e59d8908152f467132052eca96c6b9e7df23e60f8a2c7a55f5861e954
4
- data.tar.gz: 378c8a4a9dd44c41b7d77145f28f6010d3175fafdeec5e7ce049d0ec2e8babda
3
+ metadata.gz: 1f2e2dd87b67447e8ec1404be4f904fe1339e536dabddde397662313a7bb116d
4
+ data.tar.gz: 467c115d0fff87ded2aa4a7d761419f74ce9b45798f12568e21d97e1b261599f
5
5
  SHA512:
6
- metadata.gz: d4d529c07b78b42af5783adcc43a9a0195e81d6a061ce6409598bb6316b64660c38e74c959773a81152390913cf25b982f8b5c5bafa674da9d6394bb29fd8490
7
- data.tar.gz: bf4009a207501a0ce88b0f1ce4983c9eb035461f41f31e329a4cd842b63efec2f2f6adc3ff25fa23e5b46e8296a2e245ddebda51fed3237eb3758cbe3e73d463
6
+ metadata.gz: 3cc3b61d71972b7150fdbf7331ce1e55d447fabecbc4ba55914ce2621a9221fbb913efa31b715f80f77ff807dba06b3f89e26454ef623d8d2bc26af6b6f442a3
7
+ data.tar.gz: b459527ad5f9301dd75b1e2f5c9d6e6418e7c019c3a0073a4c6e905b9118db5193bcad051bba88fd5f55cbf124037332ed6a940cd857e4c59d67127d02dbb951
@@ -304,7 +304,7 @@ module Spring
304
304
  ensure
305
305
  if $!
306
306
  lib = File.expand_path("..", __FILE__)
307
- $!.backtrace.reject! { |line| line.start_with?(lib) }
307
+ $!.backtrace.reject! { |line| line.start_with?(lib) } unless $!.backtrace.frozen?
308
308
  end
309
309
  end
310
310
  end
data/lib/spring/json.rb CHANGED
@@ -46,8 +46,6 @@ end
46
46
 
47
47
  # See https://github.com/kr/okjson for updates.
48
48
 
49
- require 'stringio'
50
-
51
49
  # Some parts adapted from
52
50
  # https://golang.org/src/pkg/json/decode.go and
53
51
  # https://golang.org/src/pkg/utf8/utf8.go
@@ -468,19 +466,18 @@ private
468
466
 
469
467
 
470
468
  def strenc(s)
471
- t = StringIO.new
472
- t.putc(?")
469
+ t = '"'.b
473
470
  r = 0
474
471
 
475
472
  while r < s.length
476
473
  case s[r]
477
- when ?" then t.print('\\"')
478
- when ?\\ then t.print('\\\\')
479
- when ?\b then t.print('\\b')
480
- when ?\f then t.print('\\f')
481
- when ?\n then t.print('\\n')
482
- when ?\r then t.print('\\r')
483
- when ?\t then t.print('\\t')
474
+ when ?" then t << '\\"'
475
+ when ?\\ then t << '\\\\'
476
+ when ?\b then t << '\\b'
477
+ when ?\f then t << '\\f'
478
+ when ?\n then t << '\\n'
479
+ when ?\r then t << '\\r'
480
+ when ?\t then t << '\\t'
484
481
  else
485
482
  c = s[r]
486
483
  # In ruby >= 1.9, s[r] is a codepoint, not a byte.
@@ -490,14 +487,14 @@ private
490
487
  if c.ord < Spc.ord
491
488
  c = "\\u%04x" % [c.ord]
492
489
  end
493
- t.write(c)
490
+ t << c
494
491
  rescue
495
- t.write(Ustrerr)
492
+ t << Ustrerr
496
493
  end
497
494
  elsif c < Spc
498
- t.write("\\u%04x" % c)
495
+ t << "\\u%04x" % c
499
496
  elsif Spc <= c && c <= ?~
500
- t.putc(c)
497
+ t << c
501
498
  else
502
499
  n = ucharcopy(t, s, r) # ensure valid UTF-8 output
503
500
  r += n - 1 # r is incremented below
@@ -505,8 +502,8 @@ private
505
502
  end
506
503
  r += 1
507
504
  end
508
- t.putc(?")
509
- t.string
505
+ t << '"'
506
+ t
510
507
  end
511
508
 
512
509
 
@@ -531,7 +528,7 @@ private
531
528
 
532
529
  # 1-byte, 7-bit sequence?
533
530
  if c0 < Utagx
534
- t.putc(c0)
531
+ t << c0
535
532
  return 1
536
533
  end
537
534
 
@@ -544,8 +541,8 @@ private
544
541
  # 2-byte, 11-bit sequence?
545
542
  if c0 < Utag3
546
543
  raise Utf8Error if ((c0&Umask2)<<6 | (c1&Umaskx)) <= Uchar1max
547
- t.putc(c0)
548
- t.putc(c1)
544
+ t << c0
545
+ t << c1
549
546
  return 2
550
547
  end
551
548
 
@@ -559,9 +556,9 @@ private
559
556
  if c0 < Utag4
560
557
  u = (c0&Umask3)<<12 | (c1&Umaskx)<<6 | (c2&Umaskx)
561
558
  raise Utf8Error if u <= Uchar2max
562
- t.putc(c0)
563
- t.putc(c1)
564
- t.putc(c2)
559
+ t << c0
560
+ t << c1
561
+ t << c2
565
562
  return 3
566
563
  end
567
564
 
@@ -574,16 +571,16 @@ private
574
571
  if c0 < Utag5
575
572
  u = (c0&Umask4)<<18 | (c1&Umaskx)<<12 | (c2&Umaskx)<<6 | (c3&Umaskx)
576
573
  raise Utf8Error if u <= Uchar3max
577
- t.putc(c0)
578
- t.putc(c1)
579
- t.putc(c2)
580
- t.putc(c3)
574
+ t << c0
575
+ t << c1
576
+ t << c2
577
+ t << c3
581
578
  return 4
582
579
  end
583
580
 
584
581
  raise Utf8Error
585
582
  rescue Utf8Error
586
- t.write(Ustrerr)
583
+ t << Ustrerr
587
584
  return 1
588
585
  end
589
586
 
@@ -1,3 +1,3 @@
1
1
  module Spring
2
- VERSION = "3.1.0"
2
+ VERSION = "3.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spring
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Leighton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-23 00:00:00.000000000 Z
11
+ date: 2021-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake