laminar 0.5.1 → 0.6.0

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: 2d1b19197989df6be81a680a0764fca81e9aec6768d51d5cd2d2be5e9972220d
4
- data.tar.gz: 77fbcfdbc00774e528c5500091a48eb77bc3af2f2d30b4c8815dd70783a197df
3
+ metadata.gz: ea86f0c10d91bc035b654382cc02a5d3fe66201f29c7f68c59c5ea775089cc87
4
+ data.tar.gz: a2c93e7cd9b38caa0049d13686dba98b96753147257abc0f7ec12c80494b498f
5
5
  SHA512:
6
- metadata.gz: 59ee3d20026d279ce6f3aa548fd1a675b675590134704ab836a94b6a3c9c1ccb9049bdda92680f3becf17af4f0c21c75106246d55ba5d69cc78075b803769825
7
- data.tar.gz: 96f7cf730af8943910f74acd0b6fb056ef3b24910481370847fa5992a8472f5d8b1ce4420c45a0ed11025b82ff332beb5ffe243cea95e16f7679cc4ac3fa3d2d
6
+ metadata.gz: 803fb931223366209b3146a501580950649bdecf3006677dd28838dfc214bc82623bcf1b9c504710e5f921e1630fa03aa60f4840775ce4ca4655a4ea1764e410
7
+ data.tar.gz: 333b5fac15453582b529e7dd00b6f62ef4b70a815b95109224f0219932e48a54f91b0abea4576ce7a0e626e23809f78c0e090868fa7f08b7e8370e76fd6bcc12
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .ruby-version
1
2
  *.gem
2
3
  Gemfile.lock
3
4
  /.bundle/
@@ -1,7 +1,22 @@
1
- Metrics/LineLength:
1
+ Layout/LineLength:
2
2
  Max: 99
3
3
  AllCops:
4
4
  TargetRubyVersion: 2.3.0
5
5
 
6
6
  Metrics/MethodLength:
7
7
  Max: 12
8
+
9
+ Lint/RaiseException:
10
+ Enabled: true
11
+
12
+ Lint/StructNewOverride:
13
+ Enabled: true
14
+
15
+ Style/HashEachMethods:
16
+ Enabled: true
17
+
18
+ Style/HashTransformKeys:
19
+ Enabled: true
20
+
21
+ Style/HashTransformValues:
22
+ Enabled: true
@@ -1,6 +1,18 @@
1
- # Change Log
1
+ # Changelog
2
+
3
+ ## [v0.6.0](https://github.com/rmlockerd/laminar/tree/v0.6.0) (2020-04-15)
4
+
5
+ - Add 'finalize' callback on particles and flows that is called after
6
+ invocation finishes, regardless of whether particle halted.
7
+
8
+ [Full Changelog](https://github.com/rmlockerd/laminar/compare/v0.5.1...v0.6.0)
9
+
10
+ ## [v0.5.1](https://github.com/rmlockerd/laminar/tree/v0.5.1) (2020-03-06)
11
+
12
+ [Full Changelog](https://github.com/rmlockerd/laminar/compare/v0.5.0...v0.5.1)
2
13
 
3
14
  ## [v0.5.0](https://github.com/rmlockerd/laminar/tree/v0.5.0) (2018-11-12)
15
+
4
16
  [Full Changelog](https://github.com/rmlockerd/laminar/compare/v0.4.0...v0.5.0)
5
17
 
6
18
  **Implemented enhancements:**
@@ -13,6 +25,7 @@
13
25
  - Branch conditionals \(if:/unless:\) do not get context passed [\#10](https://github.com/rmlockerd/laminar/issues/10)
14
26
 
15
27
  ## [v0.4.0](https://github.com/rmlockerd/laminar/tree/v0.4.0) (2018-10-12)
28
+
16
29
  [Full Changelog](https://github.com/rmlockerd/laminar/compare/v0.3.0...v0.4.0)
17
30
 
18
31
  **Implemented enhancements:**
@@ -24,6 +37,7 @@
24
37
  - branch if/unless don't accept blocks/Procs [\#7](https://github.com/rmlockerd/laminar/issues/7)
25
38
 
26
39
  ## [v0.3.0](https://github.com/rmlockerd/laminar/tree/v0.3.0) (2018-10-01)
40
+
27
41
  [Full Changelog](https://github.com/rmlockerd/laminar/compare/v0.2.0...v0.3.0)
28
42
 
29
43
  **Implemented enhancements:**
@@ -35,10 +49,13 @@
35
49
  - Add before/after particle callbacks [\#1](https://github.com/rmlockerd/laminar/issues/1)
36
50
 
37
51
  ## [v0.2.0](https://github.com/rmlockerd/laminar/tree/v0.2.0) (2018-09-27)
52
+
53
+ [Full Changelog](https://github.com/rmlockerd/laminar/compare/8bd9c0f01bae6cfd7f5df58c3c792068fa30366d...v0.2.0)
54
+
38
55
  **Fixed bugs:**
39
56
 
40
57
  - .gemspec missing active\_support dependency [\#4](https://github.com/rmlockerd/laminar/issues/4)
41
58
 
42
59
 
43
60
 
44
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
61
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
@@ -33,10 +33,10 @@ Gem::Specification.new do |spec|
33
33
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
34
  spec.require_paths = ['lib']
35
35
 
36
- spec.add_development_dependency 'activesupport', '>= 4.2'
36
+ spec.add_development_dependency 'activesupport', '~> 4.2'
37
37
 
38
38
  spec.add_development_dependency 'bundler', '~> 1.16'
39
- spec.add_development_dependency 'rake', '~> 12.3.3'
39
+ spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
40
40
  spec.add_development_dependency 'rspec', '~> 3.0'
41
41
  spec.add_development_dependency 'simplecov', '~> 0.16'
42
42
  end
@@ -24,6 +24,11 @@ module Laminar
24
24
  end
25
25
  alias after_call after
26
26
 
27
+ def finalize(*args, &block)
28
+ final_list.concat(args)
29
+ final_list << block if block
30
+ end
31
+
27
32
  def before_list
28
33
  @before_list ||= []
29
34
  end
@@ -31,6 +36,10 @@ module Laminar
31
36
  def after_list
32
37
  @after_list ||= []
33
38
  end
39
+
40
+ def final_list
41
+ @final_list ||= []
42
+ end
34
43
  end
35
44
 
36
45
  # Additional instance methods
@@ -45,6 +54,10 @@ module Laminar
45
54
  run_callbacks(self.class.after_list)
46
55
  end
47
56
 
57
+ def run_final_callbacks
58
+ run_callbacks(self.class.final_list)
59
+ end
60
+
48
61
  def run_callbacks(list)
49
62
  list.each { |cb| cb.is_a?(Symbol) ? send(cb) : instance_exec(&cb) }
50
63
  end
@@ -39,12 +39,18 @@ module Laminar
39
39
  end
40
40
 
41
41
  def invoke!
42
- run_before_callbacks
43
- return context if context.halted?
42
+ begin
43
+ run_before_callbacks
44
+ return context if context.halted?
44
45
 
45
- param_list = context_slice
46
- param_list.empty? ? call : call(context_slice)
47
- run_after_callbacks unless context.halted?
46
+ param_list = context_slice
47
+ param_list.empty? ? call : call(context_slice)
48
+ run_after_callbacks unless context.halted?
49
+ rescue ParticleStopped
50
+ run_final_callbacks
51
+ raise
52
+ end
53
+ run_final_callbacks
48
54
  context
49
55
  end
50
56
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Laminar
4
- VERSION = '0.5.1'
4
+ VERSION = '0.6.0'
5
5
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: laminar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Lockerd
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-06 00:00:00.000000000 Z
11
+ date: 2020-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
@@ -43,6 +43,9 @@ dependencies:
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '12.3'
48
+ - - ">="
46
49
  - !ruby/object:Gem::Version
47
50
  version: 12.3.3
48
51
  type: :development
@@ -50,6 +53,9 @@ dependencies:
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
55
  - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: '12.3'
58
+ - - ">="
53
59
  - !ruby/object:Gem::Version
54
60
  version: 12.3.3
55
61
  - !ruby/object:Gem::Dependency