flow 0.10.1 → 0.10.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: 6bb7054475f94b6d73503adf9168e31222098af20a36c048cdf72b68b3e0a7a5
4
- data.tar.gz: 3a6feb462916f4d24dd180d88e63527ad1e18a4d99e8cbb5ecae664d919e744a
3
+ metadata.gz: fb00b50b5c0c19093beaf572f6e050e578b58fd83d5641f1b1dac553cb5096c5
4
+ data.tar.gz: 17ceb71b234ee7aebf897ff08ed11c2db68a1c63a9338322a9619f896c53e705
5
5
  SHA512:
6
- metadata.gz: 467c98e3ab094d2af99c8c27b72cd493c4efb70bec3980c8dbe6c37d3f6101b829ded1fd80445adf4cbd83195d6143c97c4be3ddf1d1f9c87a19ab875aea07da
7
- data.tar.gz: 2bcb846816f4f3ad8599dd14970e7ffe6e5d8d0bae9b171ca6b763a6940be1105331bab14e9391c2e2d2dd5b2468cb15d15a1797351259f06af57fc09e3fa133
6
+ metadata.gz: 57537f1e3d84c95cc6018dafa17db38c71bc2b0ef606f25e67c9e875a9ca6196f604240e693cf808a227862266d6c5fc3b19c0edcfe8b29c3ae793ddbd8b37a0
7
+ data.tar.gz: 93386f65a3b4fc066c2d9d82b68be1f103290aaa63a7c0b356f0d8d9f5a6290aa80aaa8706da42450c3aff1f9904d56c280b11e0d00dc6b7f1c73a18ab2519dd
data/README.md CHANGED
@@ -124,7 +124,7 @@ Ex: `FooBarBazFlow` assumes there is a defined `FooBarBazState`.
124
124
  If you want to customize this behavior, define the state class explicitly:
125
125
 
126
126
  ```ruby
127
- class ExampleFlow < ApplicationState
127
+ class ExampleFlow < ApplicationFlow
128
128
  def self.state_class
129
129
  MyCoolState
130
130
  end
@@ -1062,7 +1062,7 @@ The easiest and best way to test an Operation is with a unit test.
1062
1062
 
1063
1063
  Operation unit tests work best when you treat them like integration tests! (Read: **No Mocking!**)
1064
1064
 
1065
- Operations are generated with the following RSPec template:
1065
+ Operations are generated with the following RSpec template:
1066
1066
 
1067
1067
  ```ruby
1068
1068
  # frozen_string_literal: true
@@ -1076,8 +1076,7 @@ RSpec.describe MakeTheThingDoTheStuff, type: :operation do
1076
1076
  let(:example_state_class) do
1077
1077
  Class.new(ApplicationState) do
1078
1078
  # argument :foo
1079
- # option :bar
1080
- # attribute :baz
1079
+
1081
1080
  # output :gaz
1082
1081
  end
1083
1082
  end
@@ -1103,8 +1102,7 @@ In the boilerplate from the generator, there is the following snippet:
1103
1102
  let(:example_state_class) do
1104
1103
  Class.new(ApplicationState) do
1105
1104
  # argument :foo
1106
- # option :bar
1107
- # attribute :baz
1105
+
1108
1106
  # output :gaz
1109
1107
  end
1110
1108
  end
@@ -1122,21 +1120,23 @@ You are heavily encouraged *not* to do that. If your Operation is used by severa
1122
1120
 
1123
1121
  Instead, use the spec as a way to communicate the contract of the Operation with the next developer. By boiling out a very clean example state that only includes what is necessary for the operation, you provide clear guidance on what the Operation's minimum requirements for a state are in a very transparent way.
1124
1122
 
1123
+ However, the emphasis is on _minimum_ requirements. `Option`s and `attribute`s are therefore discouraged in example states for operation specs, as well are contexts for when optional input is not provided. An operation designed for use with a State using optional inputs will _always_ require those methods to be available on its state class, so example states should always use arguments to define input.
1124
+
1125
1125
  ```ruby
1126
1126
  let(:example_state_class) do
1127
1127
  Class.new(ApplicationState) do
1128
1128
  argument :foo
1129
- option :bar
1130
- attribute :baz
1129
+ argument :bar
1130
+
1131
1131
  output :gaz
1132
1132
  end
1133
1133
 
1134
1134
  let(:state_input) do
1135
- { foo: foo, bar: bar }
1135
+ { foo: foo }
1136
1136
  end
1137
1137
 
1138
1138
  let(:foo) { ... }
1139
- let(:bar) { ... }
1139
+ let(:bar) { nil }
1140
1140
  end
1141
1141
  ```
1142
1142
 
@@ -1183,7 +1183,11 @@ RSpec.describe FooState, type: :state do
1183
1183
  # it { is_expected.to define_argument :necessary_input, allow_nil: false }
1184
1184
  # it { is_expected.to define_option(:optional_input) }
1185
1185
  # it { is_expected.to define_option(:option_with_default, default: :default_static_value) }
1186
+
1187
+ # let(:default_block_value) { SecureRandom.uuid }
1188
+ # before { allow(SecureRandom).to receive(:uuid).and_return(default_block_value) }
1186
1189
  # it { is_expected.to define_option(:option_with_default_from_block, default: default_block_value) }
1190
+
1187
1191
  # it { is_expected.to validate_presence_of ... }
1188
1192
  # it { is_expected.to define_output :foo }
1189
1193
  # it { is_expected.to define_output :foo, default: :bar }
data/lib/flow/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flow
4
- VERSION = "0.10.1"
4
+ VERSION = "0.10.2"
5
5
  end
@@ -9,8 +9,7 @@ RSpec.describe <%= class_name %>, type: :operation do
9
9
  let(:example_state_class) do
10
10
  Class.new(ApplicationState) do
11
11
  # argument :foo
12
- # option :bar
13
- # attribute :baz
12
+
14
13
  # output :gaz
15
14
  end
16
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside
@@ -12,48 +12,48 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2019-06-14 00:00:00.000000000 Z
15
+ date: 2019-09-19 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activemodel
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - "~>"
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
23
  version: 5.2.1
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - "~>"
28
+ - - ">="
29
29
  - !ruby/object:Gem::Version
30
30
  version: 5.2.1
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: activerecord
33
33
  requirement: !ruby/object:Gem::Requirement
34
34
  requirements:
35
- - - "~>"
35
+ - - ">="
36
36
  - !ruby/object:Gem::Version
37
37
  version: 5.2.1
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - "~>"
42
+ - - ">="
43
43
  - !ruby/object:Gem::Version
44
44
  version: 5.2.1
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: activesupport
47
47
  requirement: !ruby/object:Gem::Requirement
48
48
  requirements:
49
- - - "~>"
49
+ - - ">="
50
50
  - !ruby/object:Gem::Version
51
51
  version: 5.2.1
52
52
  type: :runtime
53
53
  prerelease: false
54
54
  version_requirements: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - "~>"
56
+ - - ">="
57
57
  - !ruby/object:Gem::Version
58
58
  version: 5.2.1
59
59
  - !ruby/object:Gem::Dependency
@@ -166,14 +166,14 @@ dependencies:
166
166
  requirements:
167
167
  - - "~>"
168
168
  - !ruby/object:Gem::Version
169
- version: 1.3.6
169
+ version: '1.3'
170
170
  type: :development
171
171
  prerelease: false
172
172
  version_requirements: !ruby/object:Gem::Requirement
173
173
  requirements:
174
174
  - - "~>"
175
175
  - !ruby/object:Gem::Version
176
- version: 1.3.6
176
+ version: '1.3'
177
177
  - !ruby/object:Gem::Dependency
178
178
  name: rspice
179
179
  requirement: !ruby/object:Gem::Requirement
@@ -334,8 +334,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
334
  - !ruby/object:Gem::Version
335
335
  version: '0'
336
336
  requirements: []
337
- rubyforge_project:
338
- rubygems_version: 2.7.6
337
+ rubygems_version: 3.0.3
339
338
  signing_key:
340
339
  specification_version: 4
341
340
  summary: Write modular and reusable business logic that's understandable and maintainable.