cow_proxy 0.2.0 → 0.2.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
- SHA1:
3
- metadata.gz: 5734151ca0f1283bf177dc381ba8d360542c8592
4
- data.tar.gz: 72ff1be5e09e74f47913c3925770a1d90b6d517a
2
+ SHA256:
3
+ metadata.gz: 5c1dc57faf10fbc39c1d95e9a43da5d5cbde931cb46be01d479c192949ae607c
4
+ data.tar.gz: 336d11aa720b1e41408d9849c922584dc3867f3c838d7c695be157b6ffd489b4
5
5
  SHA512:
6
- metadata.gz: c0495f7a2a83f85d17aa7a38f5c09483c4674dcc98dc8b11f6fb6f6756b63d0fac421f899e4d0c17651e1732b0d7c8b414eb4d436f821d31151738b51a247d26
7
- data.tar.gz: 2c75c262bbc0eb327c26d220723e42eb1e244461c45da01e0001093bec66a437a3e8c458e9de2a6e79fae96581d736c01f1b428cf3efc3bcf1b9827fb848fd8e
6
+ metadata.gz: 15335c75aadb3656ec1c88b7b2afabce03b4d6a5fe3e018317a655bccda2a914a8261e8f98719c433c7c43d584e70d8c48ef63c6d61e980d506387b72b8ec6f0
7
+ data.tar.gz: 3cb31d2fa247cafeb2c530dc931f3ebe2907a2b22ecfcf4f0a460b9b13a6a0c533d6e4967a88c75f7381f8c5d342aa52fce9aa14b6323487f076ed21fdc0ced5
data/lib/cow_proxy.rb CHANGED
@@ -127,11 +127,16 @@ end
127
127
  [Integer, Float, Symbol, TrueClass, FalseClass, NilClass].each do |klass|
128
128
  CowProxy.register_proxy klass, nil
129
129
  end
130
- if defined? Fixnum
131
- CowProxy.register_proxy Fixnum, nil
132
- end
133
- if defined? Bignum
134
- CowProxy.register_proxy Bignum, nil
130
+
131
+ if 1.class == Integer
132
+ CowProxy.register_proxy Integer, nil
133
+ else
134
+ if defined? Fixnum
135
+ CowProxy.register_proxy Fixnum, nil
136
+ end
137
+ if defined? Bignum
138
+ CowProxy.register_proxy Bignum, nil
139
+ end
135
140
  end
136
141
 
137
142
  require 'cow_proxy/base.rb'
@@ -1,6 +1,15 @@
1
1
  module CowProxy
2
2
  # Wrapper class for String
3
3
  class String < WrapClass(::String)
4
+ # returns the wrapped object.
5
+ #
6
+ # needed to used wrapped string inside interpolation
7
+ #
8
+ # @return the wrapped object.
9
+ def to_s
10
+ __getobj__
11
+ end
12
+
4
13
  # returns the wrapped object.
5
14
  #
6
15
  # needed to used wrapped string as parameter for send
@@ -10,4 +19,4 @@ module CowProxy
10
19
  __getobj__
11
20
  end
12
21
  end
13
- end
22
+ end
@@ -2,7 +2,7 @@ module CowProxy
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- PATCH = 0
5
+ PATCH = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cow_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-28 00:00:00.000000000 Z
11
+ date: 2019-03-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Make a COW proxy for a frozen object (or deep frozen), it will delegate
14
14
  every read method to proxied object, wrap value in COW proxy if frozen. Trying to
@@ -50,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  version: '0'
51
51
  requirements: []
52
52
  rubyforge_project:
53
- rubygems_version: 2.5.1
53
+ rubygems_version: 2.7.8
54
54
  signing_key:
55
55
  specification_version: 4
56
56
  summary: Copy-on-write proxy class, to use with frozen objects