callable_tree 0.3.1 → 0.3.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
  SHA256:
3
- metadata.gz: c16eb0b2fd83ffd98d61bca938bd449dac9c004e8240c4f1a3b61242bf841163
4
- data.tar.gz: 9919ffcda275a5a5bcf81b0bfae40087cae1f701fc0b7b915fece81c21a79d6b
3
+ metadata.gz: 5a506dec2678a69b014cff69b6cc4fd94e22b1f7f5027e9230727720c8dc049e
4
+ data.tar.gz: 3b7ee0419139ef24f40f8b0714cbd19551568967d0170a4b550a84f528811da4
5
5
  SHA512:
6
- metadata.gz: 98c022cc2b12dccf2333f1a1fc079febe80f597bbbfbd4565384b88987c92c2426d7986ee80c11e1361139b95d495fdff9237e4f986d57dbb7eb355ce8244a0b
7
- data.tar.gz: bcee44379ab11292a5c3bba4b0d37f2bdc2a6f587f9a2a757c11c6093d29fdbd1fe20bd9e0ee6561d98785121222ae1959b412ca8b4ecb5ddf579504f5a704c4
6
+ metadata.gz: b84af5f3ae12941eabdb1cdbc159d9a3f424388bffab74c2704d5507a875c924ae637b2b868194244d2530bcbd8bf5895118e42f7a79c91f901854896d686eb5
7
+ data.tar.gz: 816f558c0118c57bda18c3b69fef45240c9de5e87a1acea0bcf1f9448e0c67e34a7de613292796635f8e5c16d1835c2ba4bdef959939c44a6358bce94197a82a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.2] - 2022-02-05
4
+
5
+ - Change `CallableTree::Node::Hooks::Call#before_call` to return a new instance.
6
+ To keep the same behavior as the older version, use `CallableTree::Node::Hooks::Call#before_call!` that makes destructive change.
7
+ - Change `CallableTree::Node::Hooks::Call#around_call` to return a new instance.
8
+ To keep the same behavior as the older version, use `CallableTree::Node::Hooks::Call#around_call!` that makes destructive change.
9
+ - Change `CallableTree::Node::Hooks::Call#after_call` to return a new instance.
10
+ To keep the same behavior as the older version, use `CallableTree::Node::Hooks::Call#after_call!` that makes destructive change.
11
+
3
12
  ## [0.3.1] - 2022-01-10
4
13
 
5
14
  - Add `CallableTree::Node::Internal#seek?` to check whether the node's strategy is `seek` or not.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- callable_tree (0.3.1)
4
+ callable_tree (0.3.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -12,12 +12,12 @@ GEM
12
12
  rspec-core (~> 3.10.0)
13
13
  rspec-expectations (~> 3.10.0)
14
14
  rspec-mocks (~> 3.10.0)
15
- rspec-core (3.10.1)
15
+ rspec-core (3.10.2)
16
16
  rspec-support (~> 3.10.0)
17
- rspec-expectations (3.10.1)
17
+ rspec-expectations (3.10.2)
18
18
  diff-lcs (>= 1.2.0, < 2.0)
19
19
  rspec-support (~> 3.10.0)
20
- rspec-mocks (3.10.2)
20
+ rspec-mocks (3.10.3)
21
21
  diff-lcs (>= 1.2.0, < 2.0)
22
22
  rspec-support (~> 3.10.0)
23
23
  rspec-support (3.10.3)
@@ -9,9 +9,10 @@ module Node
9
9
  end
10
10
  end
11
11
 
12
- Node::HooksSample.new
12
+ Node::HooksSample
13
+ .new
13
14
  .before_call do |input, **_options|
14
- puts "before_call input: #{input}";
15
+ puts "before_call input: #{input}"
15
16
  input + 1
16
17
  end
17
18
  .append(
@@ -9,16 +9,28 @@ module CallableTree
9
9
  end
10
10
 
11
11
  def before_call(&block)
12
+ clone.before_call!(&block)
13
+ end
14
+
15
+ def before_call!(&block)
12
16
  before_callbacks << block
13
17
  self
14
18
  end
15
19
 
16
20
  def around_call(&block)
21
+ clone.around_call!(&block)
22
+ end
23
+
24
+ def around_call!(&block)
17
25
  around_callbacks << block
18
26
  self
19
27
  end
20
28
 
21
29
  def after_call(&block)
30
+ clone.after_call!(&block)
31
+ end
32
+
33
+ def after_call!(&block)
22
34
  after_callbacks << block
23
35
  self
24
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CallableTree
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: callable_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jsmmr
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-10 00:00:00.000000000 Z
11
+ date: 2022-02-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Builds a tree by linking callable nodes. The nodes that match the conditions
14
14
  are called in a chain from the root node to the leaf node. These are like nested
@@ -62,7 +62,7 @@ licenses:
62
62
  metadata:
63
63
  homepage_uri: https://github.com/jsmmr/ruby_callable_tree
64
64
  source_code_uri: https://github.com/jsmmr/ruby_callable_tree
65
- changelog_uri: https://github.com/jsmmr/ruby_callable_tree/blob/v0.3.1/CHANGELOG.md
65
+ changelog_uri: https://github.com/jsmmr/ruby_callable_tree/blob/v0.3.2/CHANGELOG.md
66
66
  post_install_message:
67
67
  rdoc_options: []
68
68
  require_paths: