nest 3.1.1 → 3.1.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/.gems +2 -2
- data/CHANGELOG.md +18 -0
- data/lib/nest.rb +9 -6
- data/nest.gemspec +1 -1
- data/test/nest_test.rb +19 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8b4051899b40f130c9023399b34fe3b3047a0170c07e6dfc073eafa57374fa2a
|
4
|
+
data.tar.gz: 26a22e4a124299b661d4f4027cc2428c0b6168eaa136504d8ccaea8e052da2e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd3a7b2c6fdd0e38aed0df1c80a989f3c2806341eecacfe50dc84b662daabcbca9f5d161780ce3f3bb5524adf8dba88986859941aabf2bc134dcf3b1dba20846
|
7
|
+
data.tar.gz: a9eae2a74da50282559d4c76f5ea93fc87d83a3b0f84ebccd93c8b3f528da8276f562ba1c2abbbc62348fa97e13f1ef9a8f7b35e11dfba6aaf0e7e9bade2c324
|
data/.gems
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
redic -v 1.
|
2
|
-
cutest -v 1.2.
|
1
|
+
redic -v 1.5.1
|
2
|
+
cutest -v 1.2.3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
## 3.1.2
|
2
|
+
|
3
|
+
- Define to_json
|
4
|
+
|
5
|
+
This solves issues that arise when a third party library redefines
|
6
|
+
`to_json` for all objects.
|
7
|
+
|
8
|
+
## 3.1.1
|
9
|
+
|
10
|
+
- Define to_a and to_ary
|
11
|
+
|
12
|
+
These method definitions are needed for interacting with array-casting
|
13
|
+
operations like Array#flatten and Array().
|
14
|
+
|
15
|
+
## 3.1.0
|
16
|
+
|
17
|
+
- Forward missing methods to Redis as commands
|
18
|
+
|
1
19
|
## 3.0.0
|
2
20
|
|
3
21
|
- Use `call` for interacting with Redis
|
data/lib/nest.rb
CHANGED
@@ -38,16 +38,19 @@ class Nest
|
|
38
38
|
@ns.hash
|
39
39
|
end
|
40
40
|
|
41
|
-
def to_s
|
42
|
-
@ns
|
43
|
-
end
|
44
|
-
|
45
41
|
def to_ary
|
46
42
|
nil
|
47
43
|
end
|
48
44
|
|
49
|
-
def
|
50
|
-
|
45
|
+
def to_str
|
46
|
+
@ns
|
47
|
+
end
|
48
|
+
|
49
|
+
alias to_s to_str
|
50
|
+
alias to_a to_ary
|
51
|
+
|
52
|
+
def to_json(*args)
|
53
|
+
@ns.to_json(*args)
|
51
54
|
end
|
52
55
|
|
53
56
|
def call(command, *args)
|
data/nest.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "nest"
|
3
|
-
s.version = "3.1.
|
3
|
+
s.version = "3.1.2"
|
4
4
|
s.summary = "Object-oriented keys for Redis."
|
5
5
|
s.description = "It is a design pattern in key-value databases to use the key to simulate structure, and Nest can take care of that."
|
6
6
|
s.license = "MIT"
|
data/test/nest_test.rb
CHANGED
@@ -87,3 +87,22 @@ scope do
|
|
87
87
|
assert_equal [n1], Array(n1)
|
88
88
|
end
|
89
89
|
end
|
90
|
+
|
91
|
+
# Operations that call to_str and to_ary
|
92
|
+
scope do
|
93
|
+
test "interaction with string-casting operations" do
|
94
|
+
n1 = Nest.new("foo")
|
95
|
+
s1 = "bar"
|
96
|
+
|
97
|
+
s2 = s1 + n1
|
98
|
+
|
99
|
+
assert_equal "barfoo", s1 + n1
|
100
|
+
end
|
101
|
+
|
102
|
+
test "interaction with array-casting operations" do
|
103
|
+
n1 = Nest.new("foo")
|
104
|
+
|
105
|
+
assert_equal [n1], [n1].flatten
|
106
|
+
assert_equal [n1], Array(n1)
|
107
|
+
end
|
108
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michel Martens
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redic
|
@@ -76,8 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
requirements: []
|
79
|
-
|
80
|
-
rubygems_version: 2.4.5.1
|
79
|
+
rubygems_version: 3.0.1
|
81
80
|
signing_key:
|
82
81
|
specification_version: 4
|
83
82
|
summary: Object-oriented keys for Redis.
|