ruson 1.3.1 → 1.3.2
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.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.ruby-version +1 -0
- data/README.md +1 -1
- data/lib/ruson/base.rb +1 -1
- data/lib/ruson/class/array.rb +6 -4
- data/lib/ruson/class/boolean.rb +13 -11
- data/lib/ruson/class/float.rb +6 -4
- data/lib/ruson/class/integer.rb +6 -4
- data/lib/ruson/class/time.rb +12 -10
- data/lib/ruson/converter.rb +1 -1
- data/lib/ruson/version.rb +1 -1
- data/ruson.gemspec +4 -3
- metadata +11 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5beb4ec0c137e8258f492afe125896967a3e1d13f7d35d1acc8590c9e9791b1b
|
4
|
+
data.tar.gz: 7a74b9b661870665d00630253ca8b860e809ea14a09c67d2a0d66c084ce48e1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79c4580249dfa2c701ff28c4e81dd108949742007fc52600e600f639ddac2314cb4b2cb3ea22ebe18eb5b1e4257d2311fcdcce4597555e538235ec9262474ece
|
7
|
+
data.tar.gz: 7b98c33a2d5f2bb373fa9a62a567cd4989a13b7a330c357c3e794b9b187355ec79fe39f3d7c95d33abae2487cc2b5aeb3b07d8b521a033325020e770bb89230f
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.0
|
data/README.md
CHANGED
data/lib/ruson/base.rb
CHANGED
@@ -89,7 +89,7 @@ module Ruson
|
|
89
89
|
res.inject({}) do |result, attributes|
|
90
90
|
key, value = attributes
|
91
91
|
accessor = self.class.accessors[key]
|
92
|
-
if accessor && accessor
|
92
|
+
if accessor && accessor.key?(:name)
|
93
93
|
result[accessor[:name]] = value
|
94
94
|
else
|
95
95
|
result[key] = value
|
data/lib/ruson/class/array.rb
CHANGED
data/lib/ruson/class/boolean.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module Ruson
|
2
|
+
class Boolean
|
3
|
+
def self.new(value)
|
4
|
+
return value if value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
case value
|
7
|
+
when 'true'
|
8
|
+
return true
|
9
|
+
when 'false'
|
10
|
+
return false
|
11
|
+
else
|
12
|
+
return false
|
13
|
+
end
|
12
14
|
end
|
13
15
|
end
|
14
|
-
end
|
16
|
+
end
|
data/lib/ruson/class/float.rb
CHANGED
data/lib/ruson/class/integer.rb
CHANGED
data/lib/ruson/class/time.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
module Ruson
|
2
|
+
class Time
|
3
|
+
def self.new(value)
|
4
|
+
case value
|
5
|
+
when ::Integer, ::Float
|
6
|
+
::Time.at(value).to_time
|
7
|
+
when ::String
|
8
|
+
::Time.parse(value).to_time
|
9
|
+
else
|
10
|
+
value
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
12
|
-
end
|
14
|
+
end
|
data/lib/ruson/converter.rb
CHANGED
data/lib/ruson/version.rb
CHANGED
data/ruson.gemspec
CHANGED
@@ -7,12 +7,13 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = 'ruson'
|
8
8
|
spec.version = Ruson::VERSION
|
9
9
|
spec.authors = ['klriutsa']
|
10
|
-
spec.email = ['hiroya
|
10
|
+
spec.email = ['kurushima.hiroya@gmail.com']
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.description = %q{
|
12
|
+
spec.summary = %q{A Ruby serialization/deserialization library to convert Ruby Objects into JSON and back}
|
13
|
+
spec.description = %q{A Ruby serialization/deserialization library to convert Ruby Objects into JSON and back}
|
14
14
|
spec.homepage = 'https://github.com/klriutsa/ruson'
|
15
15
|
spec.license = 'MIT'
|
16
|
+
spec.required_ruby_version = '>= 2.5'
|
16
17
|
|
17
18
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
19
|
f.match(%r{^(test|spec|features)/})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- klriutsa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -94,15 +94,17 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.9.1
|
97
|
-
description:
|
97
|
+
description: A Ruby serialization/deserialization library to convert Ruby Objects
|
98
|
+
into JSON and back
|
98
99
|
email:
|
99
|
-
- hiroya
|
100
|
+
- kurushima.hiroya@gmail.com
|
100
101
|
executables: []
|
101
102
|
extensions: []
|
102
103
|
extra_rdoc_files: []
|
103
104
|
files:
|
104
105
|
- ".gitignore"
|
105
106
|
- ".rspec"
|
107
|
+
- ".ruby-version"
|
106
108
|
- ".travis.yml"
|
107
109
|
- CODE_OF_CONDUCT.md
|
108
110
|
- Dockerfile
|
@@ -140,15 +142,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
140
142
|
requirements:
|
141
143
|
- - ">="
|
142
144
|
- !ruby/object:Gem::Version
|
143
|
-
version: '
|
145
|
+
version: '2.5'
|
144
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
147
|
requirements:
|
146
148
|
- - ">="
|
147
149
|
- !ruby/object:Gem::Version
|
148
150
|
version: '0'
|
149
151
|
requirements: []
|
150
|
-
|
152
|
+
rubyforge_project:
|
153
|
+
rubygems_version: 2.7.3
|
151
154
|
signing_key:
|
152
155
|
specification_version: 4
|
153
|
-
summary:
|
156
|
+
summary: A Ruby serialization/deserialization library to convert Ruby Objects into
|
157
|
+
JSON and back
|
154
158
|
test_files: []
|