disposable 0.2.1 → 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
2
  SHA1:
3
- metadata.gz: 31d57820d95d0f0c679a690f4f5571fecbe972d4
4
- data.tar.gz: 9ca35177d6953ebdc3fc2d3b8d7f2040177586ef
3
+ metadata.gz: f714cb418f7788e8fdfe157660f02e9899a1e457
4
+ data.tar.gz: d9aff55447493719b64c2b88a5c44d4668b40765
5
5
  SHA512:
6
- metadata.gz: 56f4d3c54f0c4515da447474ab3618cd218eafe534377a0e7d0be4b4ac34e1d9d611c94874b44167fb176aea725b6f1dcabe5f1c26df4e05fde5e877cf4d5467
7
- data.tar.gz: 38dce808bde55025f706c3900290569410a7fce94ce13882489fa4dabf93f36c4d4c10930f7ddddb847238c43bcbac12c522c46c04594f9909a3c93618a9e3a3
6
+ metadata.gz: 8f3fb2157bd0afa059d7cf1f964964f3db9c00608a1c67aa7daeb68624b02b4dd10f64048e2ba4b98c9a5a153df7177b6d1fc8c95e22cb42911138f7056fda61
7
+ data.tar.gz: 97dae2d7decbe780d89697925d23ea6dec33a54c3e69b9f61b71121483323d9c7ff0b1af33405a0d4862d9a595199d90c3d414617bdf76dc53a66eea8c7fb2c5
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.2.2
2
+
3
+ * Use `Uber::Options::Value#call` to evaluate.
4
+ * Add `Twin::Collection#append`.
5
+
1
6
  # 0.2.1
2
7
 
3
8
  * In `Callback::Group#call`, the `context` option now allows running callbacks in different contexts. Per default, the group instance is context.
@@ -14,6 +14,11 @@ module Disposable
14
14
  end
15
15
  attr_reader :original # TODO: test me and rethink me.
16
16
 
17
+ # Note that this expects a model, untwinned.
18
+ def append(model)
19
+ (self << model).last
20
+ end
21
+
17
22
  # Note that this expects a model, untwinned.
18
23
  def <<(model)
19
24
  super(twin = @twinner.(model))
@@ -92,4 +97,4 @@ module Disposable
92
97
  end # Semantics.
93
98
  end
94
99
  end
95
- end
100
+ end
@@ -10,7 +10,7 @@ module Disposable::Twin::Default
10
10
  # TODO: introduce Null object in Declarative::Definition#[].
11
11
  # dfn[:default].(self) # dfn#[] should return a Null object here if empty.
12
12
  return unless dfn[:default]
13
- dfn[:default].evaluate(self) # TODO: use .()
13
+ dfn[:default].(self) # TODO: use .()
14
14
  end
15
15
 
16
16
  module ClassMethods
@@ -1,3 +1,3 @@
1
1
  module Disposable
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -215,9 +215,21 @@ class CollectionUnitTest < MiniTest::Spec
215
215
  collection.insert(0, Model::Album.new).must_be_instance_of Twin::Album
216
216
  end
217
217
 
218
+ # #append(model)
219
+ it do
220
+ collection.append(Model::Album.new).must_be_instance_of Twin::Album
221
+ collection[0].must_be_instance_of Twin::Album
222
+
223
+ # allows subsequent calls.
224
+ collection.append(Model::Album.new)
225
+ collection[1].must_be_instance_of Twin::Album
226
+
227
+ collection.size.must_equal 2
228
+ end
229
+
218
230
  # #<<
219
231
  it do
220
- collection << Model::Album.new
232
+ (collection << Model::Album.new).must_be_instance_of Array
221
233
  collection[0].must_be_instance_of Twin::Album
222
234
  end
223
- end
235
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: disposable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-12 00:00:00.000000000 Z
11
+ date: 2015-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uber