oj 3.9.1 → 3.9.2

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: 4a9bfd0e254e8c30855238077fd24a8398fe6f51027d061865a4bae5b8843577
4
- data.tar.gz: df12b305f11cae6ed49e002b64f02681df83b613674cec99baeaacc9e9308b27
3
+ metadata.gz: 52a998aa9f2273e995d9ef52e26df3f8998aae1a98d7d088f6973cf8234a444f
4
+ data.tar.gz: 26647fb39df6d357074e5798bf263ca708a361cf910eba43c7c7a3d1ba905f51
5
5
  SHA512:
6
- metadata.gz: 69db529090d8152e069fab0bb18327ba9cb823817e6282aafeb3caf073a723964e7daf9bf40ffe4921306d8b0caf0fa71e1912bfa6c9c411ee7b87ba8aa4be60
7
- data.tar.gz: c438cdbc8e9ecb36a47b09d88a8e8170a76b1cb04ca966586b8096dbf176503aa9e88da3d4d429f1ad3bc0aef696f58d6367620a35c0f93fc5fda3ec43caa4f9
6
+ metadata.gz: 9dffec2bd8c447ca172aa4a647a719c1cc62eeedab91ea30b79943fa212e4b78a10b3e3ddfd69e873e632c3bdddce2d955d34aa106dfa7e4f43618ea842aa829
7
+ data.tar.gz: 5dd30d0dcaf87e9b57c16ad13f0e7654ab8b8b02d8b3709f20614025283101bc44cedf4470bb2bb887b41a280d2e4b131f77a26a65a8e79447771a6bc5cca42d
@@ -1049,6 +1049,10 @@ CLEANUP:
1049
1049
  msg = rb_str_append(msg, oj_encode(rb_str_new2(pi->json)));
1050
1050
  }
1051
1051
  args[0] = msg;
1052
+ if (pi->err.clas == oj_parse_error_class) {
1053
+ // The error was an Oj::ParseError so change to a JSON::ParseError.
1054
+ pi->err.clas = oj_json_parser_error_class;
1055
+ }
1052
1056
  rb_exc_raise(rb_class_new_instance(1, args, pi->err.clas));
1053
1057
  } else {
1054
1058
  oj_err_raise(&pi->err);
@@ -898,6 +898,10 @@ CLEANUP:
898
898
  // idea.
899
899
  VALUE args[] = { oj_encode(rb_str_new2(pi->err.msg)) };
900
900
 
901
+ if (pi->err.clas == oj_parse_error_class) {
902
+ // The error was an Oj::ParseError so change to a JSON::ParseError.
903
+ pi->err.clas = oj_json_parser_error_class;
904
+ }
901
905
  rb_exc_raise(rb_class_new_instance(1, args, pi->err.clas));
902
906
  } else {
903
907
  oj_err_raise(&pi->err);
@@ -110,7 +110,7 @@ sec_as_time(int64_t secs, TimeInfo ti) {
110
110
  }
111
111
  }
112
112
  }
113
- ti->year = (qc - shift) * 400 + c * 100 + qy * 4 + y;
113
+ ti->year = (int)((qc - (int64_t)shift) * 400 + c * 100 + qy * 4 + y);
114
114
  if (leap) {
115
115
  ms = eom_leap_secs;
116
116
  } else {
@@ -125,12 +125,12 @@ sec_as_time(int64_t secs, TimeInfo ti) {
125
125
  break;
126
126
  }
127
127
  }
128
- ti->day = secs / 86400LL;
128
+ ti->day = (int)(secs / 86400LL);
129
129
  secs = secs - (int64_t)ti->day * 86400LL;
130
130
  ti->day++;
131
- ti->hour = secs / 3600LL;
131
+ ti->hour = (int)(secs / 3600LL);
132
132
  secs = secs - (int64_t)ti->hour * 3600LL;
133
- ti->min = secs / 60LL;
133
+ ti->min = (int)(secs / 60LL);
134
134
  secs = secs - (int64_t)ti->min * 60LL;
135
- ti->sec = secs;
135
+ ti->sec = (int)secs;
136
136
  }
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '3.9.1'
4
+ VERSION = '3.9.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oj
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.1
4
+ version: 3.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-31 00:00:00.000000000 Z
11
+ date: 2019-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler