nest 3.1.1 → 3.1.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: 4c4c4aeff5206eb5114db89a069fbc03d2be990f
4
- data.tar.gz: 17d53051af21384b2e806057a632ff3a0aea9e0f
2
+ SHA256:
3
+ metadata.gz: 8b4051899b40f130c9023399b34fe3b3047a0170c07e6dfc073eafa57374fa2a
4
+ data.tar.gz: 26a22e4a124299b661d4f4027cc2428c0b6168eaa136504d8ccaea8e052da2e9
5
5
  SHA512:
6
- metadata.gz: 7f15b661917706692398bf84b70827ed514a328a9c62e578ff15d4837f3d8216058ae224292452f216d4be1f40a37df94b28874c28cbb8a6db0fa6b72593398d
7
- data.tar.gz: ace8ba7d6cc84c30b4424b16e46eced592b6a7e436925d75555ed83ca40edd1566b14f73fba421782427aa8fe6e77a8bce5c17ccb321639f1377a26ea38488a2
6
+ metadata.gz: cd3a7b2c6fdd0e38aed0df1c80a989f3c2806341eecacfe50dc84b662daabcbca9f5d161780ce3f3bb5524adf8dba88986859941aabf2bc134dcf3b1dba20846
7
+ data.tar.gz: a9eae2a74da50282559d4c76f5ea93fc87d83a3b0f84ebccd93c8b3f528da8276f562ba1c2abbbc62348fa97e13f1ef9a8f7b35e11dfba6aaf0e7e9bade2c324
data/.gems CHANGED
@@ -1,2 +1,2 @@
1
- redic -v 1.4.1
2
- cutest -v 1.2.2
1
+ redic -v 1.5.1
2
+ cutest -v 1.2.3
@@ -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
@@ -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 to_a
50
- nil
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)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "nest"
3
- s.version = "3.1.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"
@@ -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.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: 2017-04-17 00:00:00.000000000 Z
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
- rubyforge_project:
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.