rack-app 3.5.1 → 3.5.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
  SHA1:
3
- metadata.gz: f009d77e7f8904677beee67abaaa1eadc4de43db
4
- data.tar.gz: f79bf0cb29b7d29102077e5591c81dfb99cafd36
3
+ metadata.gz: 8920a6343145bbc939f0dacf8c7d78e12968f3b6
4
+ data.tar.gz: a5e359df0d707b86d354ea8ad3f73dd8ddc52c84
5
5
  SHA512:
6
- metadata.gz: 56592eba5bff8d82c1301bf9b00aa599d2eb19ac6be4f517d6d8e1d924fb4ff498179426327aa9749d2ee9563b48762d070540521ee1c69608ee215b03696db8
7
- data.tar.gz: dbb2fcb3da28381cb9e7b49d00220b1418c831094e98897378c14db568ec7fa005013e124c0c542a922824df3d70ed173df36877e17857323f2534375c54250c
6
+ metadata.gz: f5d792881a13efcde9273212e6f40433def1313eb3352e7b615660d301db79302fa18b59bd4504a4a3b49a985482942426b8ad8a2682dad28debccc965675343
7
+ data.tar.gz: f80bbd2fb7b8c0c90be59fb073f4d9192f2f28518a1eb13476dbe9b49036afa8a50752b756553fe0b0a015da2d80730a5e8ea1cec439c701828657c1267bfca9
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.5.1
1
+ 3.5.2
@@ -11,18 +11,18 @@ module Rack::App::Utils::DeepDup
11
11
  protected
12
12
 
13
13
  def registered(object, register)
14
- register[object.object_id]
14
+ register[object.__id__]
15
15
  end
16
16
 
17
17
  def register_duplication(register, object, duplicate)
18
- register[object.object_id]= duplicate
18
+ register[object.__id__]= duplicate
19
19
  duplicate
20
20
  end
21
21
 
22
22
  def dup(register, object)
23
23
 
24
- return object unless registrable?(object)
25
24
  return registered(object, register) if registered(object, register)
25
+ return register_duplication(register, object, object) unless identifiable?(object)
26
26
 
27
27
  case object
28
28
 
@@ -47,9 +47,8 @@ module Rack::App::Utils::DeepDup
47
47
  end
48
48
  end
49
49
 
50
- def registrable?(object)
51
- object.object_id
52
- true
50
+ def identifiable?(object)
51
+ object.class && object.respond_to?(:is_a?)
53
52
  rescue NoMethodError
54
53
  false
55
54
  end
@@ -105,7 +104,7 @@ module Rack::App::Utils::DeepDup
105
104
  def set_instance_variable(duplicate, instance_variable_name, value_to_set)
106
105
  duplicate.instance_variable_set(instance_variable_name, value_to_set)
107
106
  rescue NoMethodError
108
- duplicate.instance_eval("#{instance_variable_name} = Marshal.load(#{Marshal.dump(value_to_set).inspect})")
107
+ duplicate.instance_eval("#{instance_variable_name} = Marshal.load(#{Marshal.dump(value_to_set).to_s.inspect})")
109
108
  end
110
109
 
111
110
  def try_dup(object)
@@ -115,7 +114,7 @@ module Rack::App::Utils::DeepDup
115
114
  end
116
115
 
117
116
  def respond_to_instance_variables?(object)
118
- object.respond_to?(:instance_variables)
117
+ object.respond_to?(:instance_variables) && object.instance_variables.is_a?(Array)
119
118
  rescue NoMethodError
120
119
  false
121
120
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.1
4
+ version: 3.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Luzsi