declarative 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ab032b5544502fa2a01df856e3428cbe833c319
4
- data.tar.gz: 1fa86db96bf352a9c19077e9f873524556d7977f
3
+ metadata.gz: c98390ed3e76619fa18ba957ed6b03b05929dd09
4
+ data.tar.gz: 66134914bba1a3b8fc39d9f4316e0292dcd53ff0
5
5
  SHA512:
6
- metadata.gz: 4ec13db2b7873e515bd79ecf88c666cb60ad0236f51f00c154a1fe26cd8a54f524a619821545fc4f543cd2109ff75899ef3abf635393c09fa5fe78a037cb03fd
7
- data.tar.gz: 144864e4b5ea0b6ae8d8429a61b28814ae3764dfa588c64224459c29e99d4f10dc5f944fbb84f1f8026a9ea4ab679d85d91376085d47082b501095eafb1eb30b
6
+ metadata.gz: 203b7692773222fe5104e464ac6444fb571b0d0df9b8625be00f7c8b8d03f3dbc8e76972ed19f3128c4c946ca0a98045e6b787ca5dfd00d98310a92667707680
7
+ data.tar.gz: 364e53c6e76737d40c1255fca40c7f62db0b20902b4b05238a696579d5d2df0c18a385b000a547a2681b3ef705c155a53c29e55585033278d30a82e393f7b8c3
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.0.7
2
+
3
+ * Simplify `Defaults` and remove a warning in Ruby 2.2.3.
4
+
1
5
  # 0.0.6
2
6
 
3
7
  * `Heritage#call` now accepts a block that allows processing the arguments for every recorded statement before replaying them. This provides a hook to inject or change parameters, e.g. to mark a replay as an inheritance.
@@ -3,7 +3,8 @@ require "uber/delegates"
3
3
  module Declarative
4
4
  class Defaults
5
5
  def initialize
6
- @static_options = {}
6
+ @static_options = {}
7
+ @dynamic_options = ->(*) { Hash.new }
7
8
  end
8
9
 
9
10
  def merge!(hash, &block)
@@ -18,14 +19,8 @@ module Declarative
18
19
  # TODO: allow to receive rest of options/block in dynamic block. or, rather, test it as it was already implemented.
19
20
  def call(name, given_options)
20
21
  options = @static_options
21
- options = options.merge(dynamic_options(name, given_options))
22
+ options = options.merge(@dynamic_options.(name, given_options))
22
23
  options = options.merge(given_options)
23
24
  end
24
-
25
- private
26
- def dynamic_options(name, given_options)
27
- return {} if @dynamic_options.nil?
28
- @dynamic_options.call(name, given_options)
29
- end
30
25
  end
31
- end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module Declarative
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: declarative
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-21 00:00:00.000000000 Z
11
+ date: 2016-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uber