Skip to content

Commit

Permalink
adds support for ItemsPath and MaxConcurrency
Browse files Browse the repository at this point in the history
`Map` states allow two optional fields, `ItemsPath` and `MaxConcurrency`, which were being incorrectly
raised as errors when parsing state machines that made use of these fields.

- updates the _j2119_ specification to allow for these fields (fixes
  #29)
- cleans up warnings when building the gemspec by specifying the version
  of the `j2119` gem in a more constrained manner.
- updates `Gemfile` so that the version of `j2119` agrred with the
  version in the `gemspec`
- removed unnecessary `$LOAD_PATH` manipulation from all ruby files in the
  project (refs #20)
  • Loading branch information
xentek committed Oct 31, 2019
1 parent 5d171af commit 49e438a
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source "https://rubygems.org"

gem 'j2119', '>=0.3.0'
gem 'j2119', '>=0.4.0'
gem 'rake', '>=12.3.2'
gem 'rspec', '>=3.8.0'
2 changes: 2 additions & 0 deletions data/StateMachine.j2119
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ A Wait State MUST have only one of "Seconds", "SecondsPath", "Timestamp", and "T
A Wait State MUST have a field named one of "Seconds", "SecondsPath", "Timestamp", or "TimestampPath".
A Parallel State MUST have an object-array field named "Branches"; each element is a "Branch".
A Map State MUST have an object field named "Iterator"; its value is a "Branch".
A Map State MAY have a referencePath field named "ItemsPath".
A Map State MAY have a numeric field named "MaxConcurrency".
A Branch MUST have an object field named "States"; each field is a "State".
A Branch MUST have a string field named "StartAt".
A Branch MAY have a string field named "Comment".
1 change: 0 additions & 1 deletion lib/statelint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# permissions and limitations under the License.
#!/usr/bin/env ruby

$:.unshift("#{File.expand_path(File.dirname(__FILE__))}/../lib")
require 'j2119'
require 'statelint/state_node'

Expand Down
1 change: 0 additions & 1 deletion spec/state_node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# permissions and limitations under the License.
#!/usr/bin/env ruby

$:.unshift("#{File.expand_path(File.dirname(__FILE__))}/../lib")
require 'json'
require 'statelint/state_node'

Expand Down
1 change: 0 additions & 1 deletion spec/statelint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# permissions and limitations under the License.
#!/usr/bin/env ruby

$:.unshift("#{File.expand_path(File.dirname(__FILE__))}/../lib")
require 'json'
require 'statelint'

Expand Down
4 changes: 2 additions & 2 deletions statelint.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'statelint'
s.version = '0.3.0'
s.version = '0.4.1'
s.summary = "State Machine JSON validator"
s.description = "Validates a JSON object representing a State Machine"
s.authors = ["Tim Bray"]
Expand All @@ -15,7 +15,7 @@ Gem::Specification.new do |s|

s.required_ruby_version = '>= 1.9.2'

s.add_runtime_dependency 'j2119', '>= 0.3.0'
s.add_runtime_dependency 'j2119', '~> 0.4', '>= 0.4.0'

s.metadata = {
'source_code_uri' => 'https://github.com/awslabs/statelint',
Expand Down

0 comments on commit 49e438a

Please sign in to comment.