aws-flow 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,22 @@
1
+ ##
2
+ # Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License").
5
+ # You may not use this file except in compliance with the License.
6
+ # A copy of the License is located at
7
+ #
8
+ # http://aws.amazon.com/apache2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is distributed
11
+ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12
+ # express or implied. See the License for the specific language governing
13
+ # permissions and limitations under the License.
14
+ ##
15
+
16
+ #!/usr/bin/ruby -wKU
17
+
18
+ def require_all(path)
19
+ Dir[File.join(File.dirname(__FILE__), path, "*.rb")].each {|f| require f}
20
+ end
21
+
22
+ require_all('rubyflow/')
@@ -0,0 +1,63 @@
1
+ ##
2
+ # Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License").
5
+ # You may not use this file except in compliance with the License.
6
+ # A copy of the License is located at
7
+ #
8
+ # http://aws.amazon.com/apache2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is distributed
11
+ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12
+ # express or implied. See the License for the specific language governing
13
+ # permissions and limitations under the License.
14
+ ##
15
+
16
+ describe SimpleDFA do
17
+ before(:each) do
18
+ class Tester
19
+ attr_accessor :trace
20
+
21
+ extend SimpleDFA
22
+ init(:start_state)
23
+
24
+ def initialize
25
+ @trace = []
26
+ end
27
+
28
+ add_transition(:start_state, :a) do |t|
29
+ t.trace << :start_to_second
30
+ t.current_state = :second_state
31
+ end
32
+ add_transition(:second_state, :b) do |t|
33
+ t.trace << :second_to_third
34
+ t.current_state = :third_state
35
+ end
36
+ add_transition(:third_state, :c) do |t|
37
+ t.trace << :third_to_start
38
+ t.current_state = :start_state
39
+ end
40
+ end
41
+ @this_dfa = Tester.new
42
+
43
+ end
44
+
45
+ it "ensures that consume works as expected" do
46
+ @this_dfa.consume(:a)
47
+ @this_dfa.trace.should == [:start_to_second]
48
+ @this_dfa.current_state.should == :second_state
49
+ end
50
+
51
+ it "ensures that define_general defines general transitions for a state" do
52
+ class Tester
53
+ define_general(:start_state) {|t| t.current_state = :new_state }
54
+ end
55
+ @this_dfa.consume(:c)
56
+ @this_dfa.current_state.should == :new_state
57
+ end
58
+
59
+ it "ensures that uncovered_transitions raises on those transitions" do
60
+ expect { @this_dfa.consume(:b) }.to raise_error
61
+ end
62
+
63
+ end
@@ -13,11 +13,17 @@
13
13
  # permissions and limitations under the License.
14
14
  ##
15
15
 
16
- require 'aws/decider'
16
+ require 'aws/flow'
17
17
 
18
- # So that we can have a method called context
19
- Spec::DSL::Main.class_eval do
20
- if method_defined? :context
21
- undef :context
18
+ include AWS::Flow::Core
19
+
20
+
21
+ def constantize(camel_case_word)
22
+ names = camel_case_word.split('::')
23
+ names.shift if names.empty? || names.first.empty?
24
+ constant = Object
25
+ names.each do |name|
26
+ constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
22
27
  end
28
+ constant
23
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-01 00:00:00.000000000 Z
12
+ date: 2013-12-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk
@@ -80,10 +80,30 @@ files:
80
80
  - lib/aws/decider/workflow_definition.rb
81
81
  - lib/aws/decider/workflow_definition_factory.rb
82
82
  - lib/aws/decider/workflow_enabled.rb
83
+ - lib/aws/flow.rb
84
+ - lib/aws/flow/async_backtrace.rb
85
+ - lib/aws/flow/async_scope.rb
86
+ - lib/aws/flow/begin_rescue_ensure.rb
87
+ - lib/aws/flow/fiber.rb
88
+ - lib/aws/flow/flow_utils.rb
89
+ - lib/aws/flow/future.rb
90
+ - lib/aws/flow/implementation.rb
91
+ - lib/aws/flow/simple_dfa.rb
92
+ - lib/aws/flow/tasks.rb
93
+ - test/aws/async_backtrace_spec.rb
94
+ - test/aws/async_scope_spec.rb
95
+ - test/aws/begin_rescue_ensure_spec.rb
83
96
  - test/aws/decider_spec.rb
97
+ - test/aws/external_task_spec.rb
84
98
  - test/aws/factories.rb
99
+ - test/aws/fiber_condition_variable_spec.rb
100
+ - test/aws/fiber_spec.rb
101
+ - test/aws/flow_spec.rb
102
+ - test/aws/future_spec.rb
85
103
  - test/aws/integration_spec.rb
86
104
  - test/aws/preinclude_tests.rb
105
+ - test/aws/rubyflow.rb
106
+ - test/aws/simple_dfa_spec.rb
87
107
  - test/aws/spec_helper.rb
88
108
  homepage:
89
109
  licenses: []
@@ -106,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
126
  version: '0'
107
127
  requirements: []
108
128
  rubyforge_project:
109
- rubygems_version: 1.8.25
129
+ rubygems_version: 1.8.23
110
130
  signing_key:
111
131
  specification_version: 3
112
132
  summary: AWS Flow Decider package decider