rom 3.3.2 → 3.3.3

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
  SHA1:
3
- metadata.gz: 351889d2541ad18d05c029e555b635919c68c50c
4
- data.tar.gz: c66be9ee892b0ee4c4f2c7ec6505739d9a811df1
3
+ metadata.gz: 6668c7efb86e5ea164b03271cedf244574e9bde7
4
+ data.tar.gz: 2a7403db878177957d12db58803a0e8acda09fea
5
5
  SHA512:
6
- metadata.gz: 451aa0e25642c399e67eda6cddd8db5c67b801bbea371f291094913d693e9f226ed5defe783df59dfebebf4b1fd67a3577096df13c91a63faec8a2260bf0eeed
7
- data.tar.gz: 41db751db49169072c52b16ffd07f4cbd694463dd2a64b484553d1a9542e47db81492b17d0e1914e489c4cf02dfa8f49ffd4bad905f271b4fc45177c760b7580
6
+ metadata.gz: 4dc7c86d402ca351d91da62a1c4b2d24ce2f0b9203ed021ebe5a80943e9c0ad145b85502ec3b787d99f98793ba9488a726586f9523b9cbc0d7ec84e40e81450d
7
+ data.tar.gz: 6effb40c6e224f3a9eb398bff9a984b521559dbbb3103b3d3c7f389d367e3e8b45f0f68657a546fcc98ce09ba2fe63de59cd11e0172a92dac49ce4dcf7140856
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # v3.3.3 2017-10-19
2
+
3
+ ### Fixed
4
+
5
+ * Fix warnings issued by redefining JSON types (graywolf)
6
+
7
+ [Compare v3.3.2...v3.3.3](https://github.com/rom-rb/rom/compare/v3.3.2...v3.3.3)
8
+
1
9
  # v3.3.2 2017-10-14
2
10
 
3
11
  ### Fixed
data/lib/rom/types.rb CHANGED
@@ -7,10 +7,6 @@ module ROM
7
7
 
8
8
  def self.included(other)
9
9
  other.extend(Methods)
10
- other::Coercible.extend(CoercibleMethods)
11
- other::Coercible.const_set('JSON', other::Coercible.JSON)
12
- other::Coercible.const_set('JSONHash', other::Coercible.JSONHash)
13
- other::Coercible.const_set('HashJSON', other::Coercible.HashJSON)
14
10
  super
15
11
  end
16
12
 
@@ -28,29 +24,26 @@ module ROM
28
24
  end
29
25
  end
30
26
 
31
- module CoercibleMethods
32
- def JSONHash(symbol_keys: false, type: Types::Hash)
33
- Types.Constructor(type) do |value|
34
- next Hash[value] if value.respond_to?(:to_hash)
35
-
36
- begin
37
- ::JSON.parse(value.to_s, symbolize_names: symbol_keys)
38
- rescue ::JSON::ParserError
39
- value
40
- end
27
+ def Coercible.JSONHash(symbol_keys: false, type: Types::Hash)
28
+ Types.Constructor(type) do |value|
29
+ begin
30
+ ::JSON.parse(value.to_s, symbolize_names: symbol_keys)
31
+ rescue ::JSON::ParserError
32
+ value
41
33
  end
42
34
  end
35
+ end
43
36
 
44
- def HashJSON(type: Types::String)
45
- Types.Constructor(type) do |value|
46
- next value unless value.respond_to?(:to_hash)
47
- ::JSON.dump(value)
48
- end
49
- end
37
+ def Coercible.HashJSON(type: Types::String)
38
+ Types.Constructor(type) { |value| ::JSON.dump(value) }
39
+ end
50
40
 
51
- def JSON(symbol_keys: false)
52
- self.HashJSON.meta(read: self.JSONHash(symbol_keys: symbol_keys))
53
- end
41
+ def Coercible.JSON(symbol_keys: false)
42
+ self.HashJSON.meta(read: self.JSONHash(symbol_keys: symbol_keys))
54
43
  end
44
+
45
+ Coercible::JSON = Coercible.JSON
46
+ Coercible::JSONHash = Coercible.JSONHash
47
+ Coercible::HashJSON = Coercible.HashJSON
55
48
  end
56
49
  end
data/lib/rom/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ROM
2
- VERSION = '3.3.2'.freeze
2
+ VERSION = '3.3.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.2
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-14 00:00:00.000000000 Z
11
+ date: 2017-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby