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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 703f60031e8175b459409542ce364d243e74176c
4
- data.tar.gz: 7397c054e19e469e5d3aff41f6ee4ea2a051b28c
3
+ metadata.gz: 70dd3563c6e88c6c72a33f017f43655723faed0b
4
+ data.tar.gz: 4639b3b06c099d2a87cc8eab77cd2f27bdd33cd9
5
5
  SHA512:
6
- metadata.gz: 230abf76b90e2f32c5435652e90990231698fce5237ff23b12b4a87091292e9fa8aa7cefa8527357cdece57c563d22c11136cc179bf3e875a39fd45a9a4ad530
7
- data.tar.gz: 26c23b5a2ca43c0de31110d24a0253140433d6a8b4e0d21ccabb8a2fc879fff899d99e4da04c91662da5e782e321774563379d64e25626c5b0f7948979c70e09
6
+ metadata.gz: 8ef004b40f895bc06e9b0f38a1b1ccca77edd54ffd8945ceb85707f29ef166d7cb9e941ebbffa7f6df969291fe94ea259545a33aa0069f8a11faf3b0469250d9
7
+ data.tar.gz: 697b5ed22e837011fa847c9e56081ea00b67f6486f97432b08482b43e98a528d7d4e60d6cf8671413938a01c18d08bb88d7751d961b269808008c99df8eff7f8
@@ -8,6 +8,7 @@ script:
8
8
  rvm:
9
9
  - '2.2'
10
10
  - '2.3.0'
11
+ - '2.4.0'
11
12
  # - rbx-2
12
13
  - ruby-head
13
14
  - jruby-9.1.0.0
@@ -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
@@ -5,7 +5,13 @@ gemspec
5
5
 
6
6
  group :benchmarks do
7
7
  gem "benchmark-ips", "~> 2.5"
8
- gem "activesupport", "< 5"
8
+
9
+ if RUBY_VERSION < "2.4"
10
+ gem "activesupport", "< 5"
11
+ else
12
+ gem "activesupport"
13
+ end
14
+
9
15
  gem "active_attr"
10
16
  gem "anima"
11
17
  gem "attr_extras"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "dry-initializer"
3
- gem.version = "0.10.1"
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
@@ -49,6 +49,8 @@ module Dry::Initializer
49
49
 
50
50
  def inherited(klass)
51
51
  klass.instance_variable_set :@initializer_builder, initializer_builder.dup
52
+
53
+ super
52
54
  end
53
55
 
54
56
  def self.extended(klass)
@@ -11,8 +11,10 @@ module Dry::Initializer::Plugins
11
11
  ivar = :"@#{rename}"
12
12
  lambda do |*|
13
13
  value = instance_variable_get(ivar)
14
- return if value == Dry::Initializer::UNDEFINED
15
- instance_variable_set ivar, type.call(value)
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
@@ -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.1
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-27 00:00:00.000000000 Z
12
+ date: 2016-12-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec