aasm 3.0.16 → 3.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/.travis.yml +2 -1
- data/API +34 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +1 -1
- data/HOWTO +12 -0
- data/README.md +57 -4
- data/aasm.gemspec +2 -0
- data/lib/aasm.rb +5 -4
- data/lib/aasm/aasm.rb +50 -75
- data/lib/aasm/base.rb +22 -18
- data/lib/aasm/event.rb +130 -0
- data/lib/aasm/instance_base.rb +87 -0
- data/lib/aasm/localizer.rb +54 -0
- data/lib/aasm/persistence.rb +22 -14
- data/lib/aasm/persistence/active_record_persistence.rb +38 -69
- data/lib/aasm/persistence/base.rb +42 -2
- data/lib/aasm/persistence/mongoid_persistence.rb +33 -64
- data/lib/aasm/state.rb +78 -0
- data/lib/aasm/state_machine.rb +2 -2
- data/lib/aasm/transition.rb +49 -0
- data/lib/aasm/version.rb +1 -1
- data/spec/models/active_record/api.rb +75 -0
- data/spec/models/auth_machine.rb +1 -1
- data/spec/models/bar.rb +15 -0
- data/spec/models/foo.rb +34 -0
- data/spec/models/mongoid/simple_mongoid.rb +10 -0
- data/spec/models/mongoid/{mongoid_models.rb → simple_new_dsl_mongoid.rb} +1 -12
- data/spec/models/persistence.rb +2 -1
- data/spec/models/this_name_better_not_be_in_use.rb +11 -0
- data/spec/schema.rb +1 -1
- data/spec/spec_helper.rb +8 -1
- data/spec/unit/api_spec.rb +72 -0
- data/spec/unit/callbacks_spec.rb +2 -2
- data/spec/unit/event_spec.rb +269 -0
- data/spec/unit/inspection_spec.rb +43 -5
- data/spec/unit/{supporting_classes/localizer_spec.rb → localizer_spec.rb} +2 -2
- data/spec/unit/memory_leak_spec.rb +12 -12
- data/spec/unit/persistence/active_record_persistence_spec.rb +0 -40
- data/spec/unit/persistence/mongoid_persistance_spec.rb +3 -2
- data/spec/unit/simple_example_spec.rb +6 -0
- data/spec/unit/{supporting_classes/state_spec.rb → state_spec.rb} +2 -2
- data/spec/unit/{supporting_classes/state_transition_spec.rb → transition_spec.rb} +18 -18
- metadata +127 -38
- data/lib/aasm/persistence/read_state.rb +0 -40
- data/lib/aasm/supporting_classes/event.rb +0 -146
- data/lib/aasm/supporting_classes/localizer.rb +0 -56
- data/lib/aasm/supporting_classes/state.rb +0 -80
- data/lib/aasm/supporting_classes/state_transition.rb +0 -51
- data/spec/spec_helpers/models_spec_helper.rb +0 -64
- data/spec/unit/supporting_classes/event_spec.rb +0 -203
@@ -27,6 +27,46 @@ describe 'inspection for common cases' do
|
|
27
27
|
Foo.aasm.events.should include(:null)
|
28
28
|
end
|
29
29
|
|
30
|
+
context "instance level inspection" do
|
31
|
+
let(:foo) { Foo.new }
|
32
|
+
let(:two) { FooTwo.new }
|
33
|
+
|
34
|
+
it "delivers all states" do
|
35
|
+
states = foo.aasm.states
|
36
|
+
states.should include(:open)
|
37
|
+
states.should include(:closed)
|
38
|
+
|
39
|
+
states = foo.aasm.states(:permissible => true)
|
40
|
+
states.should include(:closed)
|
41
|
+
states.should_not include(:open)
|
42
|
+
|
43
|
+
foo.close
|
44
|
+
foo.aasm.states(:permissible => true).should be_empty
|
45
|
+
end
|
46
|
+
|
47
|
+
it "delivers all states for subclasses" do
|
48
|
+
states = two.aasm.states
|
49
|
+
states.should include(:open)
|
50
|
+
states.should include(:closed)
|
51
|
+
states.should include(:foo)
|
52
|
+
|
53
|
+
states = two.aasm.states(:permissible => true)
|
54
|
+
states.should include(:closed)
|
55
|
+
states.should_not include(:open)
|
56
|
+
|
57
|
+
two.close
|
58
|
+
two.aasm.states(:permissible => true).should be_empty
|
59
|
+
end
|
60
|
+
|
61
|
+
it "delivers all events" do
|
62
|
+
events = foo.aasm.events
|
63
|
+
events.should include(:close)
|
64
|
+
events.should include(:null)
|
65
|
+
foo.close
|
66
|
+
foo.aasm.events.should be_empty
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
30
70
|
it 'should list states in the order they have been defined' do
|
31
71
|
Conversation.aasm.states.should == [:needs_attention, :read, :closed, :awaiting_response, :junk]
|
32
72
|
end
|
@@ -67,13 +107,11 @@ describe :aasm_from_states_for_state do
|
|
67
107
|
end
|
68
108
|
end
|
69
109
|
|
70
|
-
describe
|
110
|
+
describe 'permissible events' do
|
71
111
|
let(:foo) {Foo.new}
|
72
112
|
|
73
113
|
it 'work' do
|
74
|
-
foo.
|
75
|
-
foo.
|
76
|
-
foo.close
|
77
|
-
foo.aasm_events_for_current_state.should be_empty
|
114
|
+
foo.aasm.permissible_events.should include(:close)
|
115
|
+
foo.aasm.permissible_events.should_not include(:null)
|
78
116
|
end
|
79
117
|
end
|
@@ -38,7 +38,7 @@ describe 'localized state names' do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
describe AASM::
|
41
|
+
describe AASM::Localizer, "new style" do
|
42
42
|
before(:all) do
|
43
43
|
I18n.load_path << 'spec/en.yml'
|
44
44
|
I18n.default_locale = :en
|
@@ -73,7 +73,7 @@ describe AASM::SupportingClasses::Localizer, "new style" do
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
describe AASM::
|
76
|
+
describe AASM::Localizer, "deprecated style" do
|
77
77
|
before(:all) do
|
78
78
|
I18n.load_path << 'spec/en_deprecated_style.yml'
|
79
79
|
I18n.default_locale = :en
|
@@ -12,27 +12,27 @@
|
|
12
12
|
|
13
13
|
# it "should be created without memory leak" do
|
14
14
|
# machines_count = machines.size
|
15
|
-
# state_count = number_of_objects(AASM::
|
16
|
-
# event_count = number_of_objects(AASM::
|
15
|
+
# state_count = number_of_objects(AASM::State)
|
16
|
+
# event_count = number_of_objects(AASM::Event)
|
17
17
|
# puts "event_count = #{event_count}"
|
18
|
-
# transition_count = number_of_objects(AASM::
|
18
|
+
# transition_count = number_of_objects(AASM::Transition)
|
19
19
|
|
20
20
|
# load File.expand_path(File.dirname(__FILE__) + '/../models/not_auto_loaded/process.rb')
|
21
21
|
# machines.size.should == machines_count + 1 # + Process
|
22
22
|
# number_of_objects(Models::Process).should == 0
|
23
|
-
# number_of_objects(AASM::
|
24
|
-
# puts "event_count = #{number_of_objects(AASM::
|
25
|
-
# number_of_objects(AASM::
|
26
|
-
# number_of_objects(AASM::
|
23
|
+
# number_of_objects(AASM::State).should == state_count + 3 # + Process
|
24
|
+
# puts "event_count = #{number_of_objects(AASM::Event)}"
|
25
|
+
# number_of_objects(AASM::Event).should == event_count + 2 # + Process
|
26
|
+
# number_of_objects(AASM::Transition).should == transition_count + 2 # + Process
|
27
27
|
|
28
28
|
# Models.send(:remove_const, "Process") if Models.const_defined?("Process")
|
29
29
|
# load File.expand_path(File.dirname(__FILE__) + '/../models/not_auto_loaded/process.rb')
|
30
30
|
# machines.size.should == machines_count + 1 # + Process
|
31
|
-
# number_of_objects(AASM::
|
32
|
-
# # ObjectSpace.each_object(AASM::
|
33
|
-
# puts "event_count = #{number_of_objects(AASM::
|
34
|
-
# number_of_objects(AASM::
|
35
|
-
# number_of_objects(AASM::
|
31
|
+
# number_of_objects(AASM::State).should == state_count + 3 # + Process
|
32
|
+
# # ObjectSpace.each_object(AASM::Event) {|o| puts o.inspect}
|
33
|
+
# puts "event_count = #{number_of_objects(AASM::Event)}"
|
34
|
+
# number_of_objects(AASM::Event).should == event_count + 2 # + Process
|
35
|
+
# number_of_objects(AASM::Transition).should == transition_count + 2 # + Process
|
36
36
|
# end
|
37
37
|
|
38
38
|
# end
|
@@ -14,46 +14,6 @@ shared_examples_for "aasm model" do
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
describe "class methods for classes without own read or write state" do
|
18
|
-
let(:klass) {Gate}
|
19
|
-
it_should_behave_like "aasm model"
|
20
|
-
it "should include all persistence mixins" do
|
21
|
-
klass.included_modules.should be_include(AASM::Persistence::ReadState)
|
22
|
-
klass.included_modules.should be_include(AASM::Persistence::ActiveRecordPersistence::WriteState)
|
23
|
-
klass.included_modules.should be_include(AASM::Persistence::ActiveRecordPersistence::WriteStateWithoutPersistence)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
describe "class methods for classes with own read state" do
|
28
|
-
let(:klass) {Reader}
|
29
|
-
it_should_behave_like "aasm model"
|
30
|
-
it "should include all persistence mixins but read state" do
|
31
|
-
klass.included_modules.should_not be_include(AASM::Persistence::ReadState)
|
32
|
-
klass.included_modules.should be_include(AASM::Persistence::ActiveRecordPersistence::WriteState)
|
33
|
-
klass.included_modules.should be_include(AASM::Persistence::ActiveRecordPersistence::WriteStateWithoutPersistence)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe "class methods for classes with own write state" do
|
38
|
-
let(:klass) {Writer}
|
39
|
-
it_should_behave_like "aasm model"
|
40
|
-
it "should include include all persistence mixins but write state" do
|
41
|
-
klass.included_modules.should be_include(AASM::Persistence::ReadState)
|
42
|
-
klass.included_modules.should_not be_include(AASM::Persistence::ActiveRecordPersistence::WriteState)
|
43
|
-
klass.included_modules.should be_include(AASM::Persistence::ActiveRecordPersistence::WriteStateWithoutPersistence)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
describe "class methods for classes without persistence" do
|
48
|
-
let(:klass) {Transient}
|
49
|
-
it_should_behave_like "aasm model"
|
50
|
-
it "should include all mixins but persistence" do
|
51
|
-
klass.included_modules.should be_include(AASM::Persistence::ReadState)
|
52
|
-
klass.included_modules.should be_include(AASM::Persistence::ActiveRecordPersistence::WriteState)
|
53
|
-
klass.included_modules.should_not be_include(AASM::Persistence::ActiveRecordPersistence::WriteStateWithoutPersistence)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
17
|
describe "instance methods" do
|
58
18
|
let(:gate) {Gate.new}
|
59
19
|
|
@@ -1,10 +1,11 @@
|
|
1
1
|
describe 'mongoid', :if => Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3') do
|
2
|
+
# describe 'mongoid' do
|
2
3
|
|
3
4
|
before(:all) do
|
4
5
|
require 'mongoid'
|
5
6
|
require 'logger'
|
6
7
|
require 'spec_helper'
|
7
|
-
|
8
|
+
Dir[File.dirname(__FILE__) + "/../../models/mongoid/*.rb"].sort.each { |f| require File.expand_path(f) }
|
8
9
|
|
9
10
|
# if you want to see the statements while running the spec enable the following line
|
10
11
|
# Mongoid.logger = Logger.new(STDERR)
|
@@ -123,4 +124,4 @@ describe 'mongoid', :if => Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version
|
|
123
124
|
end
|
124
125
|
|
125
126
|
end
|
126
|
-
end
|
127
|
+
end
|
@@ -50,4 +50,10 @@ describe 'state machine' do
|
|
50
50
|
lambda {payment.fill_out}.should raise_error(AASM::InvalidTransition)
|
51
51
|
lambda {payment.fill_out!}.should raise_error(AASM::InvalidTransition)
|
52
52
|
end
|
53
|
+
|
54
|
+
it 'defines constants for each state name' do
|
55
|
+
Payment::STATE_INITIALISED.should eq(:initialised)
|
56
|
+
Payment::STATE_FILLED_OUT.should eq(:filled_out)
|
57
|
+
Payment::STATE_AUTHORISED.should eq(:authorised)
|
58
|
+
end
|
53
59
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe AASM::
|
3
|
+
describe AASM::State do
|
4
4
|
before(:each) do
|
5
5
|
@name = :astate
|
6
6
|
@options = { :crazy_custom_key => 'key' }
|
7
7
|
end
|
8
8
|
|
9
9
|
def new_state(options={})
|
10
|
-
AASM::
|
10
|
+
AASM::State.new(@name, Conversation, @options.merge(options))
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'should set the name' do
|
@@ -28,10 +28,10 @@ describe 'transitions' do
|
|
28
28
|
|
29
29
|
end
|
30
30
|
|
31
|
-
describe AASM::
|
31
|
+
describe AASM::Transition do
|
32
32
|
it 'should set from, to, and opts attr readers' do
|
33
33
|
opts = {:from => 'foo', :to => 'bar', :guard => 'g'}
|
34
|
-
st = AASM::
|
34
|
+
st = AASM::Transition.new(opts)
|
35
35
|
|
36
36
|
st.from.should == opts[:from]
|
37
37
|
st.to.should == opts[:to]
|
@@ -40,7 +40,7 @@ describe AASM::SupportingClasses::StateTransition do
|
|
40
40
|
|
41
41
|
it 'should pass equality check if from and to are the same' do
|
42
42
|
opts = {:from => 'foo', :to => 'bar', :guard => 'g'}
|
43
|
-
st = AASM::
|
43
|
+
st = AASM::Transition.new(opts)
|
44
44
|
|
45
45
|
obj = mock('object')
|
46
46
|
obj.stub!(:from).and_return(opts[:from])
|
@@ -51,7 +51,7 @@ describe AASM::SupportingClasses::StateTransition do
|
|
51
51
|
|
52
52
|
it 'should fail equality check if from are not the same' do
|
53
53
|
opts = {:from => 'foo', :to => 'bar', :guard => 'g'}
|
54
|
-
st = AASM::
|
54
|
+
st = AASM::Transition.new(opts)
|
55
55
|
|
56
56
|
obj = mock('object')
|
57
57
|
obj.stub!(:from).and_return('blah')
|
@@ -62,7 +62,7 @@ describe AASM::SupportingClasses::StateTransition do
|
|
62
62
|
|
63
63
|
it 'should fail equality check if to are not the same' do
|
64
64
|
opts = {:from => 'foo', :to => 'bar', :guard => 'g'}
|
65
|
-
st = AASM::
|
65
|
+
st = AASM::Transition.new(opts)
|
66
66
|
|
67
67
|
obj = mock('object')
|
68
68
|
obj.stub!(:from).and_return(opts[:from])
|
@@ -72,17 +72,17 @@ describe AASM::SupportingClasses::StateTransition do
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
describe AASM::
|
75
|
+
describe AASM::Transition, '- when performing guard checks' do
|
76
76
|
it 'should return true of there is no guard' do
|
77
77
|
opts = {:from => 'foo', :to => 'bar'}
|
78
|
-
st = AASM::
|
78
|
+
st = AASM::Transition.new(opts)
|
79
79
|
|
80
80
|
st.perform(nil).should be_true
|
81
81
|
end
|
82
82
|
|
83
83
|
it 'should call the method on the object if guard is a symbol' do
|
84
84
|
opts = {:from => 'foo', :to => 'bar', :guard => :test}
|
85
|
-
st = AASM::
|
85
|
+
st = AASM::Transition.new(opts)
|
86
86
|
|
87
87
|
obj = mock('object')
|
88
88
|
obj.should_receive(:test)
|
@@ -92,7 +92,7 @@ describe AASM::SupportingClasses::StateTransition, '- when performing guard chec
|
|
92
92
|
|
93
93
|
it 'should call the method on the object if guard is a string' do
|
94
94
|
opts = {:from => 'foo', :to => 'bar', :guard => 'test'}
|
95
|
-
st = AASM::
|
95
|
+
st = AASM::Transition.new(opts)
|
96
96
|
|
97
97
|
obj = mock('object')
|
98
98
|
obj.should_receive(:test)
|
@@ -102,7 +102,7 @@ describe AASM::SupportingClasses::StateTransition, '- when performing guard chec
|
|
102
102
|
|
103
103
|
it 'should call the proc passing the object if the guard is a proc' do
|
104
104
|
opts = {:from => 'foo', :to => 'bar', :guard => Proc.new {|o| o.test}}
|
105
|
-
st = AASM::
|
105
|
+
st = AASM::Transition.new(opts)
|
106
106
|
|
107
107
|
obj = mock('object')
|
108
108
|
obj.should_receive(:test)
|
@@ -111,10 +111,10 @@ describe AASM::SupportingClasses::StateTransition, '- when performing guard chec
|
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
|
-
describe AASM::
|
114
|
+
describe AASM::Transition, '- when executing the transition with a Proc' do
|
115
115
|
it 'should call a Proc on the object with args' do
|
116
116
|
opts = {:from => 'foo', :to => 'bar', :on_transition => Proc.new {|o| o.test}}
|
117
|
-
st = AASM::
|
117
|
+
st = AASM::Transition.new(opts)
|
118
118
|
args = {:arg1 => '1', :arg2 => '2'}
|
119
119
|
obj = mock('object')
|
120
120
|
|
@@ -125,7 +125,7 @@ describe AASM::SupportingClasses::StateTransition, '- when executing the transit
|
|
125
125
|
|
126
126
|
it 'should call a Proc on the object without args' do
|
127
127
|
opts = {:from => 'foo', :to => 'bar', :on_transition => Proc.new {||}}
|
128
|
-
st = AASM::
|
128
|
+
st = AASM::Transition.new(opts)
|
129
129
|
args = {:arg1 => '1', :arg2 => '2'}
|
130
130
|
obj = mock('object')
|
131
131
|
|
@@ -135,10 +135,10 @@ describe AASM::SupportingClasses::StateTransition, '- when executing the transit
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
138
|
-
describe AASM::
|
138
|
+
describe AASM::Transition, '- when executing the transition with an :on_transtion method call' do
|
139
139
|
it 'should accept a String for the method name' do
|
140
140
|
opts = {:from => 'foo', :to => 'bar', :on_transition => 'test'}
|
141
|
-
st = AASM::
|
141
|
+
st = AASM::Transition.new(opts)
|
142
142
|
args = {:arg1 => '1', :arg2 => '2'}
|
143
143
|
obj = mock('object')
|
144
144
|
|
@@ -149,7 +149,7 @@ describe AASM::SupportingClasses::StateTransition, '- when executing the transit
|
|
149
149
|
|
150
150
|
it 'should accept a Symbol for the method name' do
|
151
151
|
opts = {:from => 'foo', :to => 'bar', :on_transition => :test}
|
152
|
-
st = AASM::
|
152
|
+
st = AASM::Transition.new(opts)
|
153
153
|
args = {:arg1 => '1', :arg2 => '2'}
|
154
154
|
obj = mock('object')
|
155
155
|
|
@@ -160,7 +160,7 @@ describe AASM::SupportingClasses::StateTransition, '- when executing the transit
|
|
160
160
|
|
161
161
|
it 'should pass args if the target method accepts them' do
|
162
162
|
opts = {:from => 'foo', :to => 'bar', :on_transition => :test}
|
163
|
-
st = AASM::
|
163
|
+
st = AASM::Transition.new(opts)
|
164
164
|
args = {:arg1 => '1', :arg2 => '2'}
|
165
165
|
obj = mock('object')
|
166
166
|
|
@@ -175,7 +175,7 @@ describe AASM::SupportingClasses::StateTransition, '- when executing the transit
|
|
175
175
|
|
176
176
|
it 'should NOT pass args if the target method does NOT accept them' do
|
177
177
|
opts = {:from => 'foo', :to => 'bar', :on_transition => :test}
|
178
|
-
st = AASM::
|
178
|
+
st = AASM::Transition.new(opts)
|
179
179
|
args = {:arg1 => '1', :arg2 => '2'}
|
180
180
|
obj = mock('object')
|
181
181
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aasm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.17
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,11 +12,11 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-
|
15
|
+
date: 2013-04-28 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activerecord
|
19
|
-
requirement:
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
20
20
|
none: false
|
21
21
|
requirements:
|
22
22
|
- - ! '>='
|
@@ -24,10 +24,31 @@ dependencies:
|
|
24
24
|
version: '0'
|
25
25
|
type: :development
|
26
26
|
prerelease: false
|
27
|
-
version_requirements:
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: mongoid
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
type: :development
|
42
|
+
prerelease: false
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
28
49
|
- !ruby/object:Gem::Dependency
|
29
50
|
name: rake
|
30
|
-
requirement:
|
51
|
+
requirement: !ruby/object:Gem::Requirement
|
31
52
|
none: false
|
32
53
|
requirements:
|
33
54
|
- - ! '>='
|
@@ -35,10 +56,15 @@ dependencies:
|
|
35
56
|
version: '0'
|
36
57
|
type: :development
|
37
58
|
prerelease: false
|
38
|
-
version_requirements:
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
39
65
|
- !ruby/object:Gem::Dependency
|
40
66
|
name: sdoc
|
41
|
-
requirement:
|
67
|
+
requirement: !ruby/object:Gem::Requirement
|
42
68
|
none: false
|
43
69
|
requirements:
|
44
70
|
- - ! '>='
|
@@ -46,10 +72,15 @@ dependencies:
|
|
46
72
|
version: '0'
|
47
73
|
type: :development
|
48
74
|
prerelease: false
|
49
|
-
version_requirements:
|
75
|
+
version_requirements: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
50
81
|
- !ruby/object:Gem::Dependency
|
51
82
|
name: rspec
|
52
|
-
requirement:
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
53
84
|
none: false
|
54
85
|
requirements:
|
55
86
|
- - ~>
|
@@ -57,10 +88,15 @@ dependencies:
|
|
57
88
|
version: '2.0'
|
58
89
|
type: :development
|
59
90
|
prerelease: false
|
60
|
-
version_requirements:
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.0'
|
61
97
|
- !ruby/object:Gem::Dependency
|
62
98
|
name: rr
|
63
|
-
requirement:
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
64
100
|
none: false
|
65
101
|
requirements:
|
66
102
|
- - ! '>='
|
@@ -68,10 +104,15 @@ dependencies:
|
|
68
104
|
version: '0'
|
69
105
|
type: :development
|
70
106
|
prerelease: false
|
71
|
-
version_requirements:
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ! '>='
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
72
113
|
- !ruby/object:Gem::Dependency
|
73
114
|
name: shoulda
|
74
|
-
requirement:
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
75
116
|
none: false
|
76
117
|
requirements:
|
77
118
|
- - ! '>='
|
@@ -79,10 +120,15 @@ dependencies:
|
|
79
120
|
version: '0'
|
80
121
|
type: :development
|
81
122
|
prerelease: false
|
82
|
-
version_requirements:
|
123
|
+
version_requirements: !ruby/object:Gem::Requirement
|
124
|
+
none: false
|
125
|
+
requirements:
|
126
|
+
- - ! '>='
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
83
129
|
- !ruby/object:Gem::Dependency
|
84
130
|
name: sqlite3
|
85
|
-
requirement:
|
131
|
+
requirement: !ruby/object:Gem::Requirement
|
86
132
|
none: false
|
87
133
|
requirements:
|
88
134
|
- - ! '>='
|
@@ -90,10 +136,15 @@ dependencies:
|
|
90
136
|
version: '0'
|
91
137
|
type: :development
|
92
138
|
prerelease: false
|
93
|
-
version_requirements:
|
139
|
+
version_requirements: !ruby/object:Gem::Requirement
|
140
|
+
none: false
|
141
|
+
requirements:
|
142
|
+
- - ! '>='
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
94
145
|
- !ruby/object:Gem::Dependency
|
95
146
|
name: minitest
|
96
|
-
requirement:
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
97
148
|
none: false
|
98
149
|
requirements:
|
99
150
|
- - ! '>='
|
@@ -101,10 +152,15 @@ dependencies:
|
|
101
152
|
version: '0'
|
102
153
|
type: :development
|
103
154
|
prerelease: false
|
104
|
-
version_requirements:
|
155
|
+
version_requirements: !ruby/object:Gem::Requirement
|
156
|
+
none: false
|
157
|
+
requirements:
|
158
|
+
- - ! '>='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
105
161
|
- !ruby/object:Gem::Dependency
|
106
162
|
name: ruby-debug-completion
|
107
|
-
requirement:
|
163
|
+
requirement: !ruby/object:Gem::Requirement
|
108
164
|
none: false
|
109
165
|
requirements:
|
110
166
|
- - ! '>='
|
@@ -112,7 +168,28 @@ dependencies:
|
|
112
168
|
version: '0'
|
113
169
|
type: :development
|
114
170
|
prerelease: false
|
115
|
-
version_requirements:
|
171
|
+
version_requirements: !ruby/object:Gem::Requirement
|
172
|
+
none: false
|
173
|
+
requirements:
|
174
|
+
- - ! '>='
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '0'
|
177
|
+
- !ruby/object:Gem::Dependency
|
178
|
+
name: coveralls
|
179
|
+
requirement: !ruby/object:Gem::Requirement
|
180
|
+
none: false
|
181
|
+
requirements:
|
182
|
+
- - ! '>='
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: '0'
|
185
|
+
type: :development
|
186
|
+
prerelease: false
|
187
|
+
version_requirements: !ruby/object:Gem::Requirement
|
188
|
+
none: false
|
189
|
+
requirements:
|
190
|
+
- - ! '>='
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
116
193
|
description: AASM is a continuation of the acts as state machine rails plugin, built
|
117
194
|
for plain Ruby objects.
|
118
195
|
email: scott@elitists.net, ttilley@gmail.com, aasm@mt7.de
|
@@ -123,8 +200,10 @@ files:
|
|
123
200
|
- .document
|
124
201
|
- .gitignore
|
125
202
|
- .travis.yml
|
203
|
+
- API
|
126
204
|
- CHANGELOG.md
|
127
205
|
- Gemfile
|
206
|
+
- HOWTO
|
128
207
|
- LICENSE
|
129
208
|
- README.md
|
130
209
|
- Rakefile
|
@@ -134,53 +213,58 @@ files:
|
|
134
213
|
- lib/aasm/base.rb
|
135
214
|
- lib/aasm/deprecated/aasm.rb
|
136
215
|
- lib/aasm/errors.rb
|
216
|
+
- lib/aasm/event.rb
|
217
|
+
- lib/aasm/instance_base.rb
|
218
|
+
- lib/aasm/localizer.rb
|
137
219
|
- lib/aasm/persistence.rb
|
138
220
|
- lib/aasm/persistence/active_record_persistence.rb
|
139
221
|
- lib/aasm/persistence/base.rb
|
140
222
|
- lib/aasm/persistence/mongoid_persistence.rb
|
141
|
-
- lib/aasm/
|
223
|
+
- lib/aasm/state.rb
|
142
224
|
- lib/aasm/state_machine.rb
|
143
|
-
- lib/aasm/
|
144
|
-
- lib/aasm/supporting_classes/localizer.rb
|
145
|
-
- lib/aasm/supporting_classes/state.rb
|
146
|
-
- lib/aasm/supporting_classes/state_transition.rb
|
225
|
+
- lib/aasm/transition.rb
|
147
226
|
- lib/aasm/version.rb
|
148
227
|
- spec/database.yml
|
149
228
|
- spec/en.yml
|
150
229
|
- spec/en_deprecated_style.yml
|
230
|
+
- spec/models/active_record/api.rb
|
151
231
|
- spec/models/argument.rb
|
152
232
|
- spec/models/auth_machine.rb
|
233
|
+
- spec/models/bar.rb
|
153
234
|
- spec/models/callback_new_dsl.rb
|
154
235
|
- spec/models/callback_old_dsl.rb
|
155
236
|
- spec/models/conversation.rb
|
237
|
+
- spec/models/foo.rb
|
156
238
|
- spec/models/invalid_persistor.rb
|
157
|
-
- spec/models/mongoid/
|
239
|
+
- spec/models/mongoid/simple_mongoid.rb
|
240
|
+
- spec/models/mongoid/simple_new_dsl_mongoid.rb
|
158
241
|
- spec/models/not_auto_loaded/process.rb
|
159
242
|
- spec/models/parametrised_event.rb
|
160
243
|
- spec/models/persistence.rb
|
161
244
|
- spec/models/process_with_new_dsl.rb
|
162
245
|
- spec/models/silencer.rb
|
163
246
|
- spec/models/sub_classing.rb
|
247
|
+
- spec/models/this_name_better_not_be_in_use.rb
|
164
248
|
- spec/models/transactor.rb
|
165
249
|
- spec/models/validator.rb
|
166
250
|
- spec/models/worker.rb
|
167
251
|
- spec/schema.rb
|
168
252
|
- spec/spec_helper.rb
|
169
|
-
- spec/
|
253
|
+
- spec/unit/api_spec.rb
|
170
254
|
- spec/unit/callbacks_spec.rb
|
171
255
|
- spec/unit/complex_example_spec.rb
|
256
|
+
- spec/unit/event_spec.rb
|
172
257
|
- spec/unit/initial_state_spec.rb
|
173
258
|
- spec/unit/inspection_spec.rb
|
259
|
+
- spec/unit/localizer_spec.rb
|
174
260
|
- spec/unit/memory_leak_spec.rb
|
175
261
|
- spec/unit/new_dsl_spec.rb
|
176
262
|
- spec/unit/persistence/active_record_persistence_spec.rb
|
177
263
|
- spec/unit/persistence/mongoid_persistance_spec.rb
|
178
264
|
- spec/unit/simple_example_spec.rb
|
265
|
+
- spec/unit/state_spec.rb
|
179
266
|
- spec/unit/subclassing_spec.rb
|
180
|
-
- spec/unit/
|
181
|
-
- spec/unit/supporting_classes/localizer_spec.rb
|
182
|
-
- spec/unit/supporting_classes/state_spec.rb
|
183
|
-
- spec/unit/supporting_classes/state_transition_spec.rb
|
267
|
+
- spec/unit/transition_spec.rb
|
184
268
|
homepage: https://github.com/aasm/aasm
|
185
269
|
licenses:
|
186
270
|
- MIT
|
@@ -202,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
286
|
version: '0'
|
203
287
|
requirements: []
|
204
288
|
rubyforge_project:
|
205
|
-
rubygems_version: 1.8.
|
289
|
+
rubygems_version: 1.8.24
|
206
290
|
signing_key:
|
207
291
|
specification_version: 3
|
208
292
|
summary: State machine mixin for Ruby objects
|
@@ -210,36 +294,41 @@ test_files:
|
|
210
294
|
- spec/database.yml
|
211
295
|
- spec/en.yml
|
212
296
|
- spec/en_deprecated_style.yml
|
297
|
+
- spec/models/active_record/api.rb
|
213
298
|
- spec/models/argument.rb
|
214
299
|
- spec/models/auth_machine.rb
|
300
|
+
- spec/models/bar.rb
|
215
301
|
- spec/models/callback_new_dsl.rb
|
216
302
|
- spec/models/callback_old_dsl.rb
|
217
303
|
- spec/models/conversation.rb
|
304
|
+
- spec/models/foo.rb
|
218
305
|
- spec/models/invalid_persistor.rb
|
219
|
-
- spec/models/mongoid/
|
306
|
+
- spec/models/mongoid/simple_mongoid.rb
|
307
|
+
- spec/models/mongoid/simple_new_dsl_mongoid.rb
|
220
308
|
- spec/models/not_auto_loaded/process.rb
|
221
309
|
- spec/models/parametrised_event.rb
|
222
310
|
- spec/models/persistence.rb
|
223
311
|
- spec/models/process_with_new_dsl.rb
|
224
312
|
- spec/models/silencer.rb
|
225
313
|
- spec/models/sub_classing.rb
|
314
|
+
- spec/models/this_name_better_not_be_in_use.rb
|
226
315
|
- spec/models/transactor.rb
|
227
316
|
- spec/models/validator.rb
|
228
317
|
- spec/models/worker.rb
|
229
318
|
- spec/schema.rb
|
230
319
|
- spec/spec_helper.rb
|
231
|
-
- spec/
|
320
|
+
- spec/unit/api_spec.rb
|
232
321
|
- spec/unit/callbacks_spec.rb
|
233
322
|
- spec/unit/complex_example_spec.rb
|
323
|
+
- spec/unit/event_spec.rb
|
234
324
|
- spec/unit/initial_state_spec.rb
|
235
325
|
- spec/unit/inspection_spec.rb
|
326
|
+
- spec/unit/localizer_spec.rb
|
236
327
|
- spec/unit/memory_leak_spec.rb
|
237
328
|
- spec/unit/new_dsl_spec.rb
|
238
329
|
- spec/unit/persistence/active_record_persistence_spec.rb
|
239
330
|
- spec/unit/persistence/mongoid_persistance_spec.rb
|
240
331
|
- spec/unit/simple_example_spec.rb
|
332
|
+
- spec/unit/state_spec.rb
|
241
333
|
- spec/unit/subclassing_spec.rb
|
242
|
-
- spec/unit/
|
243
|
-
- spec/unit/supporting_classes/localizer_spec.rb
|
244
|
-
- spec/unit/supporting_classes/state_spec.rb
|
245
|
-
- spec/unit/supporting_classes/state_transition_spec.rb
|
334
|
+
- spec/unit/transition_spec.rb
|