json_pure 2.7.1 → 2.7.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: 1677fc4d72bfe47d97c5d12b87322e3416397f74e70bcb74ae58ff47f9029708
4
- data.tar.gz: 788a9dd2fb8d894897b2ad1bc5459c4386a148c4afe454a4f376e0b0a303c54e
3
+ metadata.gz: 0b6ca25817890c68b02dbfb6aa64691c29ed6e413824017d9a94bebf0dda07bc
4
+ data.tar.gz: 95ec5cbf92677ba4bdbaf74cb18ea7771b01dcaf4eafd0bdefb55808f4618a4d
5
5
  SHA512:
6
- metadata.gz: c46741ede86d254d0b9bd432baf2194ab087495eee883e5503845a0cf83488709d0be8d88a2f87ab741d6f3381faf744261177c2371489d7aef1ad449bb8c528
7
- data.tar.gz: c060614c537d46ac9946565a828ee17464221dc80eaed69ecc6b58c6d416b5b4d0e1397f2614af10bb23d0a2d69e99863e3d7522266ec9def718d8ec3df673fc
6
+ metadata.gz: ac21f138ae256c2a950084837406045ec312ea94a47c36c723c0e91a86404acbbc0515d5a8517ef20805bc2521517e454bd890664b8e4a4a18501db26854093d
7
+ data.tar.gz: 3b64450009fec83fc4474e524e1e85eb4a1daeaa2d039d6ab3d6e549d78ab31674ad3720274c81734ce917757b0d3351bcc705483cfea7f6d3079f3cec8e4965
data/README.md CHANGED
@@ -140,15 +140,6 @@ JSON JSON(1..10) # => 1..10
140
140
  To find out how to add JSON support to other or your own classes, read the
141
141
  section "More Examples" below.
142
142
 
143
- To get the best compatibility to rails' JSON implementation, you can
144
-
145
- ```ruby
146
- require 'json/add/rails'
147
- ```
148
-
149
- Both of the additions attempt to require `'json'` (like above) first, if it has
150
- not been required yet.
151
-
152
143
  ## Serializing exceptions
153
144
 
154
145
  The JSON module doesn't extend `Exception` by default. If you convert an `Exception`
@@ -2,7 +2,10 @@
2
2
  unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
3
3
  require 'json'
4
4
  end
5
- require 'ostruct'
5
+ begin
6
+ require 'ostruct'
7
+ rescue LoadError
8
+ end
6
9
 
7
10
  class OpenStruct
8
11
 
@@ -48,4 +51,4 @@ class OpenStruct
48
51
  def to_json(*args)
49
52
  as_json.to_json(*args)
50
53
  end
51
- end
54
+ end if defined?(::OpenStruct)
data/lib/json/common.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  #frozen_string_literal: false
2
2
  require 'json/version'
3
- require 'json/generic_object'
4
3
 
5
4
  module JSON
5
+ autoload :GenericObject, 'json/generic_object'
6
+
6
7
  NOT_SET = Object.new.freeze
7
8
  private_constant :NOT_SET
8
9
 
@@ -1,5 +1,9 @@
1
1
  #frozen_string_literal: false
2
- require 'ostruct'
2
+ begin
3
+ require 'ostruct'
4
+ rescue LoadError
5
+ warn "JSON::GenericObject requires 'ostruct'. Please install it with `gem install ostruct`."
6
+ end
3
7
 
4
8
  module JSON
5
9
  class GenericObject < OpenStruct
@@ -67,5 +71,5 @@ module JSON
67
71
  def to_json(*a)
68
72
  as_json.to_json(*a)
69
73
  end
70
- end
74
+ end if defined?(::OpenStruct)
71
75
  end
data/lib/json/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
  module JSON
3
3
  # JSON version
4
- VERSION = '2.7.1'
4
+ VERSION = '2.7.2'
5
5
  VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
6
6
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
7
7
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_pure
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 2.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-12-05 00:00:00.000000000 Z
10
+ date: 2024-04-04 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: This is a JSON implementation in pure Ruby.
14
13
  email: flori@ping.de
@@ -53,7 +52,6 @@ metadata:
53
52
  homepage_uri: https://flori.github.io/json
54
53
  source_code_uri: https://github.com/flori/json
55
54
  wiki_uri: https://github.com/flori/json/wiki
56
- post_install_message:
57
55
  rdoc_options:
58
56
  - "--title"
59
57
  - JSON implementation for ruby
@@ -72,8 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
70
  - !ruby/object:Gem::Version
73
71
  version: '0'
74
72
  requirements: []
75
- rubygems_version: 3.5.0.dev
76
- signing_key:
73
+ rubygems_version: 3.6.0.dev
77
74
  specification_version: 4
78
75
  summary: JSON Implementation for Ruby
79
76
  test_files: []