core-pipeline 0.3.0 → 0.4.0

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
  SHA256:
3
- metadata.gz: 53ee7741ae5354263c5f7d426eb7ad9b500c01bb4a1ee4c665ce11d054819cea
4
- data.tar.gz: 8c7e495b2681c54b59e38cc066987e0f52e3ba8a5673f8285c821a38eea98e9d
3
+ metadata.gz: 28a2f0e27827605918442c956cb6e4236cb146ba16c180f9418569dd09711da9
4
+ data.tar.gz: f7927e0c5657dfaa13e1bc03a48bfe0fb75ff5cb2b47d5417545c89a6cf41f78
5
5
  SHA512:
6
- metadata.gz: 757e21b99dbb927b0d75f4dbd8f036e3235a982aa9a449260bcb4e4ff09f3a20afb788c3ddcd213d2a75d5b44e105f69bf512a6515991cc97282e584e4a617f7
7
- data.tar.gz: 241b54f107db94c7fa5afeb1a075d2df1b3cd92c97bc54c9cb3935c283d6b2085d67eb1aeb85d2cb724b0cc6785f3bacb64062233ab50c5150f44bfd70603636
6
+ metadata.gz: 379641bc184684af5be9e35b02a926b5f85a52f63c83723afa95722136184a05c2474f64a8c8f67b5261989b098051eec20d5920901356dbaadc4063ee276dfa
7
+ data.tar.gz: 5bf61a391a6aac27d282eb7cb7fa8d1d973e50496316dc405760e9ef9510c7299cb46920993db62ed80b190a677342c80f4afcfd707526e14132e90621fbacc2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [v0.4.0](https://github.com/metabahn/corerb/releases/tag/2021-11-02.1)
2
+
3
+ *released on 2021-11-02*
4
+
5
+ * `add` [#98](https://github.com/metabahn/corerb/pull/98) Add a finalizer to pipelines ([bryanp](https://github.com/bryanp))
6
+
1
7
  ## [v0.3.0](https://github.com/metabahn/corerb/releases/tag/2021-11-02)
2
8
 
3
9
  *released on 2021-11-02*
@@ -102,13 +102,20 @@ module Core
102
102
  # [public] Calls the pipeline in context of an object with the given arguments.
103
103
  #
104
104
  def call(object, ...)
105
- compile.call(object, ...)
105
+ finalize.call(object, ...)
106
+ end
107
+
108
+ # [public] Finalizes the pipeline.
109
+ #
110
+ def finalize
111
+ compile
112
+
113
+ self
106
114
  end
107
115
 
108
116
  private def compile
109
117
  instance_eval(@compiler.compile(self, @object), __FILE__, __LINE__ - 1)
110
118
  @compiled = true
111
- self
112
119
  end
113
120
 
114
121
  private def recompile
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Core
4
4
  module Pipeline
5
- VERSION = "0.3.0"
5
+ VERSION = "0.4.0"
6
6
 
7
7
  def self.version
8
8
  VERSION
data/lib/is/pipeline.rb CHANGED
@@ -100,6 +100,12 @@ module Is
100
100
  end
101
101
 
102
102
  extends :implementation, prepend: true do
103
+ def finalize
104
+ super if defined?(super)
105
+ pipeline.finalize
106
+ self
107
+ end
108
+
103
109
  # [public] Halts the execution of the pipeline, setting the pipeline's current value to the given object.
104
110
  #
105
111
  private def halt(value = nil)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: core-pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Powell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-02 00:00:00.000000000 Z
11
+ date: 2021-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: core-extension