interactify 0.4.0 → 0.4.1

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
  SHA256:
3
- metadata.gz: 0ec61ad4a3a73d2c36430e29d01ae754b670ebdaab812f3d946b61adff9bf8ae
4
- data.tar.gz: b4441070a5178d6933f97adf465bce313e638fef6dc42901d4e6d84c7a8e73d2
3
+ metadata.gz: c0ac09f812f0ad0ef3787c8bba0088bcbf24853e77f054a2751778eb581e7ee2
4
+ data.tar.gz: e4cbff812c74598c1f6a846b25007ed5058e1ab89b0ad51323e49de847579291
5
5
  SHA512:
6
- metadata.gz: b0552ea7eabc4a818888a255bb674c430babf57504b921e0cfd48949e9c0cee8bd3eb722b584e28c2a1aed7643f1b277f335b827a3af1cc6d2e121feb7c0856c
7
- data.tar.gz: 73995415964151caf4f4b1977cecd558791ff14e4d475a26dda813b4403c29e2c4c59d06daf63e67800e29e44cbca558e26c970acdbef635d1a781fbfbdffada
6
+ metadata.gz: 8c3c740e8130e66acf52ffb1131f75de98eba440aa5183cc0d8b18390196c0b6ed28e61f0d4df17391c0956fe785bcd3f5d45a41fa65b8b567906b29a11c7fe1
7
+ data.tar.gz: 1ad479044c68b77f757c99a8fafd51658f99cc0d86ce947ff4ce385fbb5f32345e7cf8d0979fba2a5ddf70d2feb2158cf0fdcab3d89334641ccc670f7f93fda3
data/CHANGELOG.md CHANGED
@@ -25,3 +25,6 @@
25
25
  - All internal restructuring/refactoring into domains.
26
26
  - Add support for organize `self.if(:condition, then: A, else: B)` syntax
27
27
  - change location of matchers to `require 'interactify/rspec_matchers/matchers'`
28
+
29
+ ## [0.4.1] - 2023-12-29
30
+ - Fix bug triggered when nesting each and if
@@ -33,7 +33,7 @@ module Interactify
33
33
  end # end
34
34
 
35
35
  define_singleton_method(:source_location) do # def self.source_location
36
- const_source_location this.evaluating_receiver.to_s # [file, line]
36
+ const_source_location this.evaluating_receiver.to_s # [file, line]
37
37
  end # end
38
38
 
39
39
  define_method(:run!) do # def run!
@@ -41,9 +41,7 @@ module Interactify
41
41
  context[this.singular_resource_name] = resource # context.package = package
42
42
  context[this.singular_resource_index_name] = index # context.package_index = index
43
43
 
44
- klasses = Wrapper.wrap_many(self, this.each_loop_klasses)
45
-
46
- klasses.each do |interactor| # [A, B, C].each do |interactor|
44
+ self.class.klasses.each do |interactor| # [A, B, C].each do |interactor|
47
45
  interactor.call!(context) # interactor.call!(context)
48
46
  end # end
49
47
  end # end
@@ -54,6 +52,14 @@ module Interactify
54
52
  context # context
55
53
  end # end
56
54
 
55
+ define_singleton_method(:klasses) do # def self.klasses
56
+ klasses = instance_variable_get(:@klasses) # @klasses ||= Wrapper.wrap_many(self, [A, B, C])
57
+ return klasses if klasses
58
+
59
+ instance_variable_set(:@klasses, Wrapper.wrap_many(self, this.each_loop_klasses))
60
+ end
61
+
62
+ # "<SomeNamespace::EachPackage iterates_over: [A, B, C]>"
57
63
  define_method(:inspect) do
58
64
  "<#{this.namespace}::#{this.iterator_klass_name} iterates_over: #{this.each_loop_klasses.inspect}>"
59
65
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Interactify
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interactify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Burns
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-29 00:00:00.000000000 Z
11
+ date: 2023-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport