dry-initializer 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +7 -1
- data/dry-initializer.gemspec +1 -1
- data/lib/dry/initializer/builder.rb +2 -1
- data/lib/dry/initializer/mixin.rb +2 -0
- data/lib/dry/initializer/plugins/type_constraint.rb +4 -2
- data/spec/subclassing_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70dd3563c6e88c6c72a33f017f43655723faed0b
|
4
|
+
data.tar.gz: 4639b3b06c099d2a87cc8eab77cd2f27bdd33cd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ef004b40f895bc06e9b0f38a1b1ccca77edd54ffd8945ceb85707f29ef166d7cb9e941ebbffa7f6df969291fe94ea259545a33aa0069f8a11faf3b0469250d9
|
7
|
+
data.tar.gz: 697b5ed22e837011fa847c9e56081ea00b67f6486f97432b08482b43e98a528d7d4e60d6cf8671413938a01c18d08bb88d7751d961b269808008c99df8eff7f8
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
## v0.10.2 2016-12-31
|
2
|
+
|
3
|
+
### Added
|
4
|
+
|
5
|
+
* Support of Ruby 2.4 (@flas-gordon)
|
6
|
+
|
7
|
+
### Internal
|
8
|
+
|
9
|
+
* Code clearance for ROM integration (@flash-gordon)
|
10
|
+
|
11
|
+
[Compare v0.10.1...v0.10.2](https://github.com/dry-rb/dry-initializer/compare/v0.10.1...v0.10.2)
|
12
|
+
|
1
13
|
## v0.10.1 2016-12-27
|
2
14
|
|
3
15
|
### Fixed
|
data/Gemfile
CHANGED
data/dry-initializer.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = "dry-initializer"
|
3
|
-
gem.version = "0.10.
|
3
|
+
gem.version = "0.10.2"
|
4
4
|
gem.author = ["Vladimir Kochnev (marshall-lee)", "Andrew Kozin (nepalez)"]
|
5
5
|
gem.email = ["hashtable@yandex.ru", "andrew.kozin@gmail.com"]
|
6
6
|
gem.homepage = "https://github.com/dryrb/dry-initializer"
|
@@ -76,8 +76,9 @@ module Dry::Initializer
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def reload_initializer(mixin)
|
79
|
-
mixin.class_eval <<-RUBY
|
79
|
+
mixin.class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
80
80
|
def initialize(#{@signature.call})
|
81
|
+
@__options__ = __options__
|
81
82
|
#{@parts.select { |part| String === part }.join("\n")}
|
82
83
|
__after_initialize__
|
83
84
|
end
|
@@ -11,8 +11,10 @@ module Dry::Initializer::Plugins
|
|
11
11
|
ivar = :"@#{rename}"
|
12
12
|
lambda do |*|
|
13
13
|
value = instance_variable_get(ivar)
|
14
|
-
|
15
|
-
|
14
|
+
|
15
|
+
if value != Dry::Initializer::UNDEFINED
|
16
|
+
instance_variable_set ivar, type.call(value)
|
17
|
+
end
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
data/spec/subclassing_spec.rb
CHANGED
@@ -32,4 +32,14 @@ describe "subclassing" do
|
|
32
32
|
expect(instance_of_superclass).not_to respond_to :baz
|
33
33
|
expect(instance_of_superclass).not_to respond_to :qux
|
34
34
|
end
|
35
|
+
|
36
|
+
it "calls .inherited hook added by other mixin" do
|
37
|
+
called = false
|
38
|
+
mixin = Module.new { define_method(:inherited) { |_| called = true } }
|
39
|
+
|
40
|
+
base = Class.new { extend mixin; extend Dry::Initializer::Mixin }
|
41
|
+
Class.new(base)
|
42
|
+
|
43
|
+
expect(called).to be true
|
44
|
+
end
|
35
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-initializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Kochnev (marshall-lee)
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-12-
|
12
|
+
date: 2016-12-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|