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 +4 -4
- data/README.md +0 -9
- data/lib/json/add/ostruct.rb +5 -2
- data/lib/json/common.rb +2 -1
- data/lib/json/generic_object.rb +6 -2
- data/lib/json/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b6ca25817890c68b02dbfb6aa64691c29ed6e413824017d9a94bebf0dda07bc
|
4
|
+
data.tar.gz: 95ec5cbf92677ba4bdbaf74cb18ea7771b01dcaf4eafd0bdefb55808f4618a4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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`
|
data/lib/json/add/ostruct.rb
CHANGED
@@ -2,7 +2,10 @@
|
|
2
2
|
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
3
|
require 'json'
|
4
4
|
end
|
5
|
-
|
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
data/lib/json/generic_object.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
#frozen_string_literal: false
|
2
|
-
|
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
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.
|
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:
|
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.
|
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: []
|