ruson 1.3.1 → 1.3.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: ca2fa65cff2663ee3a6081d16d29f707ac59a972024488ca8036d500d071c5aa
4
- data.tar.gz: 5c5286b425b029c7e667f7909f32b60b0eac76d46cc028692a386e8378db4d7c
3
+ metadata.gz: 5beb4ec0c137e8258f492afe125896967a3e1d13f7d35d1acc8590c9e9791b1b
4
+ data.tar.gz: 7a74b9b661870665d00630253ca8b860e809ea14a09c67d2a0d66c084ce48e1a
5
5
  SHA512:
6
- metadata.gz: b9066c6c2df513dbed5d260d1c15b880c1bd707241d195211c583bf4cab245c4dcaef76c0f1cec72dfb50da8359a71edabcf9fbcf608c6bcf3909119672e26e6
7
- data.tar.gz: c5b71fa2d7385b882f57a52b2124c99b004d82c45fd464d61bce1fe574d26cfd517e65c61195956de4694f36da14001148ac66aad307f9d42d487923d3bb02bd
6
+ metadata.gz: 79c4580249dfa2c701ff28c4e81dd108949742007fc52600e600f639ddac2314cb4b2cb3ea22ebe18eb5b1e4257d2311fcdcce4597555e538235ec9262474ece
7
+ data.tar.gz: 7b98c33a2d5f2bb373fa9a62a567cd4989a13b7a330c357c3e794b9b187355ec79fe39f3d7c95d33abae2487cc2b5aeb3b07d8b521a033325020e770bb89230f
data/.gitignore CHANGED
@@ -10,3 +10,6 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+
14
+ # IntelliJ IDEA
15
+ /.idea/
@@ -0,0 +1 @@
1
+ 2.5.0
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruson
2
2
 
3
- Json ORM for Ruby Object
3
+ A Ruby serialization/deserialization library to convert Ruby Objects into JSON and back
4
4
 
5
5
  ## Installation
6
6
 
@@ -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&.key?(:name)
92
+ if accessor && accessor.key?(:name)
93
93
  result[accessor[:name]] = value
94
94
  else
95
95
  result[key] = value
@@ -1,5 +1,7 @@
1
- class Array
2
- def self.new(value)
3
- Array(value)
1
+ module Ruson
2
+ class Array
3
+ def self.new(value)
4
+ Array(value)
5
+ end
4
6
  end
5
- end
7
+ end
@@ -1,14 +1,16 @@
1
- class Boolean
2
- def self.new(value)
3
- return value if value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
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
- case value
6
- when 'true'
7
- return true
8
- when 'false'
9
- return false
10
- else
11
- return false
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
@@ -1,5 +1,7 @@
1
- class Float
2
- def self.new(value)
3
- value.to_f
1
+ module Ruson
2
+ class Float
3
+ def self.new(value)
4
+ value.to_f
5
+ end
4
6
  end
5
- end
7
+ end
@@ -1,5 +1,7 @@
1
- class Integer
2
- def self.new(value)
3
- value.to_i
1
+ module Ruson
2
+ class Integer
3
+ def self.new(value)
4
+ value.to_i
5
+ end
4
6
  end
5
- end
7
+ end
@@ -1,12 +1,14 @@
1
- class Time
2
- def self.new(value)
3
- case value
4
- when Integer, Float
5
- Time.at(value).to_time
6
- when String
7
- Time.parse(value).to_time
8
- else
9
- value
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
@@ -11,7 +11,7 @@ module Ruson
11
11
  private
12
12
 
13
13
  def convert_array_to_hash_value(value)
14
- if value.instance_of?(Array)
14
+ if value.instance_of?(::Array)
15
15
  value.inject([]) { |result, v| result << convert_ruson_to_hash_value(v) }
16
16
  else
17
17
  convert_ruson_to_hash_value(value)
@@ -1,3 +1,3 @@
1
1
  module Ruson
2
- VERSION = '1.3.1'
2
+ VERSION = '1.3.2'
3
3
  end
@@ -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.kurushima@litalico.co.jp']
10
+ spec.email = ['kurushima.hiroya@gmail.com']
11
11
 
12
- spec.summary = %q{ruby json library.}
13
- spec.description = %q{ruby json library.}
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.1
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: 2019-12-09 00:00:00.000000000 Z
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: ruby json library.
97
+ description: A Ruby serialization/deserialization library to convert Ruby Objects
98
+ into JSON and back
98
99
  email:
99
- - hiroya.kurushima@litalico.co.jp
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: '0'
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
- rubygems_version: 3.0.6
152
+ rubyforge_project:
153
+ rubygems_version: 2.7.3
151
154
  signing_key:
152
155
  specification_version: 4
153
- summary: ruby json library.
156
+ summary: A Ruby serialization/deserialization library to convert Ruby Objects into
157
+ JSON and back
154
158
  test_files: []