laminar 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rspec +1 -1
- data/.travis.yml +4 -0
- data/lib/laminar/context.rb +1 -1
- data/lib/laminar/flow/branch.rb +7 -3
- data/lib/laminar/flow/step.rb +4 -0
- data/lib/laminar/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cfa336597901d8c1c25976ced526555e981b731613daa6f916394b2ac71cb7a9
|
4
|
+
data.tar.gz: 9f5db130a19de3dda3ef4579bff68e103bf667e79759f5be0726c413efbacff1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d054d187381bc5c768b490df36c65a02466a0ea30f198db208006491610fa23f371e1235a0e9f37ae251ad0a3997ecfaad7490dacb909912532c5e406d5af35
|
7
|
+
data.tar.gz: 6cb99ce2b271f7f6f1782de44a3fc1b2585412441a375cd4be77ea31544fd9813f7ecfe02f3cfe8968e121762933853a7da5f533185202106e860dc42d203feb
|
data/.rspec
CHANGED
data/.travis.yml
CHANGED
@@ -9,5 +9,9 @@ rvm:
|
|
9
9
|
before_install: gem install bundler -v 1.16.5
|
10
10
|
script:
|
11
11
|
- bundle exec rspec
|
12
|
+
before_script:
|
13
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
14
|
+
- chmod +x ./cc-test-reporter
|
15
|
+
- ./cc-test-reporter before-build
|
12
16
|
after_script:
|
13
17
|
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/lib/laminar/context.rb
CHANGED
data/lib/laminar/flow/branch.rb
CHANGED
@@ -40,7 +40,11 @@ module Laminar
|
|
40
40
|
private
|
41
41
|
|
42
42
|
def run_condition(target)
|
43
|
-
|
43
|
+
if @condition.is_a?(Proc)
|
44
|
+
@condition.call()
|
45
|
+
else
|
46
|
+
target.send(@condition)
|
47
|
+
end
|
44
48
|
end
|
45
49
|
|
46
50
|
def define_condition(options)
|
@@ -48,9 +52,9 @@ module Laminar
|
|
48
52
|
return if @condition_type.nil?
|
49
53
|
|
50
54
|
@condition = options[@condition_type]
|
51
|
-
return if @condition.nil? || @condition.is_a?(Symbol)
|
55
|
+
return if @condition.nil? || @condition.is_a?(Symbol) || @condition.is_a?(Proc)
|
52
56
|
|
53
|
-
raise TypeError, 'condition must be a method
|
57
|
+
raise TypeError, 'condition must be a method symbol or Proc).'
|
54
58
|
end
|
55
59
|
end
|
56
60
|
end
|
data/lib/laminar/flow/step.rb
CHANGED
@@ -43,6 +43,10 @@ module Laminar
|
|
43
43
|
end
|
44
44
|
alias goto branch
|
45
45
|
|
46
|
+
def endflow(options = {})
|
47
|
+
branches << Branch.new(:endflow, options)
|
48
|
+
end
|
49
|
+
|
46
50
|
# Find the next rule in the flow. Examines the branches associated
|
47
51
|
# with the current rule and returns the name of the first branch
|
48
52
|
# that satisfies its condition.
|
data/lib/laminar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: laminar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.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: 2018-10-
|
11
|
+
date: 2018-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
135
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.
|
136
|
+
rubygems_version: 2.7.3
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: Simple, composable business objects & workflow
|