cow_proxy 0.2.0 → 0.2.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 +5 -5
- data/lib/cow_proxy.rb +10 -5
- data/lib/cow_proxy/string.rb +10 -1
- data/lib/cow_proxy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5c1dc57faf10fbc39c1d95e9a43da5d5cbde931cb46be01d479c192949ae607c
|
4
|
+
data.tar.gz: 336d11aa720b1e41408d9849c922584dc3867f3c838d7c695be157b6ffd489b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
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'
|
data/lib/cow_proxy/string.rb
CHANGED
@@ -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
|
data/lib/cow_proxy/version.rb
CHANGED
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.
|
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:
|
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.
|
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
|