aasm 3.0.24 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +6 -0
- data/.travis.yml +29 -4
- data/CHANGELOG.md +56 -0
- data/Gemfile +10 -1
- data/LICENSE +1 -1
- data/README.md +151 -20
- data/aasm.gemspec +5 -6
- data/gemfiles/rails_3.2.gemfile +13 -0
- data/gemfiles/rails_4.0.gemfile +16 -0
- data/gemfiles/rails_4.1.gemfile +16 -0
- data/lib/aasm/aasm.rb +36 -32
- data/lib/aasm/base.rb +49 -31
- data/lib/aasm/event.rb +28 -17
- data/lib/aasm/instance_base.rb +9 -4
- data/lib/aasm/localizer.rb +1 -1
- data/lib/aasm/persistence/active_record_persistence.rb +65 -16
- data/lib/aasm/persistence/base.rb +10 -14
- data/lib/aasm/persistence/mongoid_persistence.rb +10 -8
- data/lib/aasm/persistence/sequel_persistence.rb +108 -0
- data/lib/aasm/persistence.rb +3 -0
- data/lib/aasm/state.rb +4 -3
- data/lib/aasm/state_machine.rb +18 -10
- data/lib/aasm/transition.rb +13 -6
- data/lib/aasm/version.rb +1 -1
- data/lib/aasm.rb +0 -3
- data/spec/database.rb +33 -0
- data/spec/models/double_definer.rb +21 -0
- data/spec/models/foo.rb +2 -1
- data/spec/models/guardian.rb +48 -0
- data/spec/models/mongoid/no_scope_mongoid.rb +1 -1
- data/spec/models/mongoid/simple_mongoid.rb +5 -4
- data/spec/models/mongoid/simple_new_dsl_mongoid.rb +1 -1
- data/spec/models/not_auto_loaded/process.rb +10 -8
- data/spec/models/persistence.rb +5 -13
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/api_spec.rb +12 -12
- data/spec/unit/callbacks_spec.rb +29 -45
- data/spec/unit/complex_example_spec.rb +24 -15
- data/spec/unit/event_naming_spec.rb +24 -0
- data/spec/unit/event_spec.rb +124 -76
- data/spec/unit/guard_spec.rb +60 -0
- data/spec/unit/initial_state_spec.rb +4 -5
- data/spec/unit/inspection_spec.rb +42 -53
- data/spec/unit/localizer_spec.rb +22 -18
- data/spec/unit/memory_leak_spec.rb +2 -2
- data/spec/unit/new_dsl_spec.rb +2 -2
- data/spec/unit/persistence/active_record_persistence_spec.rb +357 -89
- data/spec/unit/persistence/mongoid_persistance_spec.rb +102 -81
- data/spec/unit/persistence/sequel_persistence_spec.rb +103 -0
- data/spec/unit/reloading_spec.rb +15 -0
- data/spec/unit/simple_example_spec.rb +20 -21
- data/spec/unit/state_spec.rb +16 -16
- data/spec/unit/subclassing_spec.rb +8 -8
- data/spec/unit/transition_spec.rb +59 -44
- metadata +38 -96
- data/lib/aasm/deprecated/aasm.rb +0 -15
- data/spec/models/callback_old_dsl.rb +0 -41
- data/spec/schema.rb +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90aa17e423f74f9397944f3e941fc539833f4a86
|
4
|
+
data.tar.gz: c18f24941a1ed1c7880140decfe262a88b37f3aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de15b7a7878ba85fe1da7f7e55bb418b499a31c3a7f3556bd66be0667e077a7c69ca2f02ce8f5066b5274a98639ca4c101f94c28c9bc113a5ba14a70876bb4eb
|
7
|
+
data.tar.gz: 9d3fd63e5bec19aae9234bf8a13a889934fd97202e4c30cdf85bd518176034c95c81a8bbd623298d728d706c46c51086375f162a1364f6c69de90ce8642af5e0
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,11 +1,36 @@
|
|
1
1
|
language: ruby
|
2
|
+
|
2
3
|
rvm:
|
3
|
-
- 1.8.7
|
4
|
+
# - 1.8.7
|
4
5
|
- 1.9.2
|
5
6
|
- 1.9.3
|
6
7
|
- 2.0.0
|
8
|
+
- 2.1
|
7
9
|
# - jruby-18mode # JRuby in 1.8 mode
|
8
|
-
|
9
|
-
- rbx-
|
10
|
-
|
10
|
+
- jruby-19mode # JRuby in 1.9 mode
|
11
|
+
- rbx-2.2.1
|
12
|
+
|
11
13
|
services: mongodb
|
14
|
+
|
15
|
+
gemfile:
|
16
|
+
- gemfiles/rails_3.2.gemfile
|
17
|
+
- gemfiles/rails_4.0.gemfile
|
18
|
+
- gemfiles/rails_4.1.gemfile
|
19
|
+
|
20
|
+
matrix:
|
21
|
+
allow_failures:
|
22
|
+
- rvm: rbx-2.2.1
|
23
|
+
- rvm: jruby-19mode
|
24
|
+
exclude:
|
25
|
+
- rvm: 1.8.7
|
26
|
+
gemfile: gemfiles/rails_4.0.gemfile
|
27
|
+
- rvm: 1.8.7
|
28
|
+
gemfile: gemfiles/rails_4.1.gemfile
|
29
|
+
- rvm: 1.9.2
|
30
|
+
gemfile: gemfiles/rails_4.0.gemfile
|
31
|
+
- rvm: 1.9.2
|
32
|
+
gemfile: gemfiles/rails_4.1.gemfile
|
33
|
+
- rvm: 1.9.3
|
34
|
+
gemfile: gemfiles/rails_4.1.gemfile
|
35
|
+
- rvm: jruby-19mode
|
36
|
+
gemfile: gemfiles/rails_4.1.gemfile
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,61 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 3.9.0 (not yet released)
|
4
|
+
|
5
|
+
* deprecated old aasm_* class methods (old-style DSL), in preparation for AASM v4.0.0
|
6
|
+
|
7
|
+
## 3.4.0
|
8
|
+
|
9
|
+
* allow retrieving the current event (`aasm.current_event`) (see [issue #159](https://github.com/aasm/aasm/issues/159) and [issue #168](https://github.com/aasm/aasm/issues/168))
|
10
|
+
|
11
|
+
## 3.3.3
|
12
|
+
|
13
|
+
* bugfix: support reloading development environment in Rails (see [issue #148](https://github.com/aasm/aasm/issues/148))
|
14
|
+
|
15
|
+
## 3.3.2
|
16
|
+
|
17
|
+
* bugfix: avoid conflicts with `failed` and `fired` event names (see [issue #157](https://github.com/aasm/aasm/issues/157)), thanks to [@MichaelXavier](https://github.com/MichaelXavier)
|
18
|
+
* bugfix: not using transactions unless saving to the database (see [issue #162](https://github.com/aasm/aasm/issues/162) and [issue #164](https://github.com/aasm/aasm/issues/164)), thanks to [@roberthoner](https://github.com/roberthoner)
|
19
|
+
* bugfix: `after_commit` should only run if saving to the database (see [issue #151](https://github.com/aasm/aasm/issues/151)), thanks to [@ivantsepp](https://github.com/ivantsepp)
|
20
|
+
|
21
|
+
## 3.3.1
|
22
|
+
|
23
|
+
* bugfix: permissible events will respect given `guards` (see [issue #150](https://github.com/aasm/aasm/issues/150))
|
24
|
+
|
25
|
+
## 3.3.0
|
26
|
+
|
27
|
+
* support for Rails 4.1 enum fields (see [issue #124](https://github.com/aasm/aasm/issues/124), thanks to [@bkon](https://github.com/bkon))
|
28
|
+
* bugfix: allow lazy-evaluation for Rails 3 scopes (see [issue #144](https://github.com/aasm/aasm/issues/144), thanks to [@laurens](https://github.com/laurens))
|
29
|
+
|
30
|
+
## 3.2.1
|
31
|
+
|
32
|
+
* bugfix: permissible_events and events did not contain events with an empty "from" transition (see [issue #140](https://github.com/aasm/aasm/issues/140) and [issue #141](https://github.com/aasm/aasm/issues/141), thanks to [@daniel-rikowski](https://github.com/daniel-rikowski))
|
33
|
+
|
34
|
+
## 3.2.0
|
35
|
+
|
36
|
+
* support [Sequel](http://sequel.jeremyevans.net/) (see [issue #119](https://github.com/aasm/aasm/issues/119), thanks to [@godfat](https://github.com/godfat))
|
37
|
+
* may not fire an unknown event (see [issue #128](https://github.com/aasm/aasm/issues/128)
|
38
|
+
|
39
|
+
## 3.1.1
|
40
|
+
|
41
|
+
* bugfix: don't require ActiveRecord for localizing AASM event and state name (see [issue #113](https://github.com/aasm/aasm/issues/113), thanks to [@silentshade](https://github.com/silentshade))
|
42
|
+
|
43
|
+
## 3.1.0
|
44
|
+
|
45
|
+
* validating the current state (see [issue #95](https://github.com/aasm/aasm/issues/95), thanks to [@ivantsepp](https://github.com/ivantsepp))
|
46
|
+
* allow configuring behavior of nested transactions (see [issue #107](https://github.com/aasm/aasm/issues/107))
|
47
|
+
* support multiple guards per transition
|
48
|
+
* support event guards (see [issue #85](https://github.com/aasm/aasm/issues/85))
|
49
|
+
* support reading from- and to-state during on_transition callback (see [issue #100](https://github.com/aasm/aasm/issues/100))
|
50
|
+
|
51
|
+
## 3.0.26
|
52
|
+
|
53
|
+
* support state.human_name (aliased to state.localized_name) (see [issue #105](https://github.com/aasm/aasm/issues/105))
|
54
|
+
|
55
|
+
## 3.0.25
|
56
|
+
|
57
|
+
* initialize the state even if validation is skipped (for ActiveRecord and Mongoid persistence) (see [issue #103](https://github.com/aasm/aasm/issues/103), thanks to [@vfonic](https://github.com/vfonic) and [@aaronklaassen](https://github.com/aaronklaassen))
|
58
|
+
|
3
59
|
## 3.0.24
|
4
60
|
|
5
61
|
* added support for event blocks (thanks to [@Intrepidd](https://github.com/Intrepidd))
|
data/Gemfile
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gem "sqlite3", :platforms => :ruby
|
4
|
+
gem "coveralls", :platforms => :ruby
|
5
|
+
gem 'rubysl', :platforms => :rbx
|
6
|
+
gem "jruby-openssl", :platforms => :jruby
|
7
|
+
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
8
|
+
gem "rails", "3.2.18"
|
9
|
+
gem 'mongoid' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3')
|
10
|
+
gem 'sequel'
|
2
11
|
|
3
12
|
gemspec
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# AASM - Ruby state machines
|
2
2
|
|
3
|
-
|
3
|
+
<a href="http://badge.fury.io/rb/aasm"><img src="https://badge.fury.io/rb/aasm@2x.png" alt="Gem Version" height="18"></a>
|
4
|
+
[![Build Status](https://travis-ci.org/aasm/aasm.svg?branch=master)](https://travis-ci.org/aasm/aasm)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/aasm/aasm.png)](https://codeclimate.com/github/aasm/aasm)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/aasm/aasm/badge.png?branch=master)](https://coveralls.io/r/aasm/aasm)
|
4
7
|
|
5
8
|
This package contains AASM, a library for adding finite state machines to Ruby classes.
|
6
9
|
|
@@ -91,7 +94,7 @@ class Job
|
|
91
94
|
state :sleeping, :initial => true, :before_enter => :do_something
|
92
95
|
state :running
|
93
96
|
|
94
|
-
event :run, :after => Proc.new {
|
97
|
+
event :run, :after => Proc.new { do_afterwards } do
|
95
98
|
transitions :from => :sleeping, :to => :running, :on_transition => Proc.new {|obj, *args| obj.set_process(*args) }
|
96
99
|
end
|
97
100
|
|
@@ -114,7 +117,7 @@ class Job
|
|
114
117
|
...
|
115
118
|
end
|
116
119
|
|
117
|
-
def
|
120
|
+
def do_afterwards
|
118
121
|
...
|
119
122
|
end
|
120
123
|
|
@@ -122,7 +125,7 @@ end
|
|
122
125
|
```
|
123
126
|
|
124
127
|
In this case `do_something` is called before actually entering the state `sleeping`,
|
125
|
-
while `
|
128
|
+
while `do_afterwards` is called after the transition `run` (from `sleeping` to `running`)
|
126
129
|
is finished.
|
127
130
|
|
128
131
|
Here you can see a list of all possible callbacks, together with their order of calling:
|
@@ -144,11 +147,47 @@ Also, you can pass parameters to events:
|
|
144
147
|
job.run(:running, :defragmentation)
|
145
148
|
```
|
146
149
|
|
147
|
-
In this case the `set_process` would be called with `:
|
150
|
+
In this case the `set_process` would be called with `:defragmentation` argument.
|
151
|
+
|
152
|
+
Note that when passing arguments to a state transition, the first argument must be the desired end state. In the above example, we wish to transition to `:running` state and run the callback with `:defragmentation` argument. You can also pass in `nil` as the desired end state, and AASM will try to transition to the first end state defined for that event.
|
148
153
|
|
149
154
|
In case of an error during the event processing the error is rescued and passed to `:error`
|
150
155
|
callback, which can handle it or re-raise it for further propagation.
|
151
156
|
|
157
|
+
During the `:on_transition` callback (and reliably only then) you can access the
|
158
|
+
originating state (the from-state) and the target state (the to state), like this:
|
159
|
+
|
160
|
+
```ruby
|
161
|
+
def set_process(name)
|
162
|
+
logger.info "from #{aasm.from_state} to #{aasm.to_state}"
|
163
|
+
end
|
164
|
+
```
|
165
|
+
|
166
|
+
#### The current event triggered
|
167
|
+
|
168
|
+
While running the callbacks you can easily retrieve the name of the event triggered
|
169
|
+
by using `aasm.current_event`:
|
170
|
+
|
171
|
+
```ruby
|
172
|
+
# taken the example callback from above
|
173
|
+
def do_something
|
174
|
+
puts "triggered #{aasm.current_event}"
|
175
|
+
end
|
176
|
+
```
|
177
|
+
|
178
|
+
and then
|
179
|
+
|
180
|
+
```ruby
|
181
|
+
job = Job.new
|
182
|
+
|
183
|
+
# without bang
|
184
|
+
job.sleep # => triggered :sleep
|
185
|
+
|
186
|
+
# with bang
|
187
|
+
job.sleep! # => triggered :sleep!
|
188
|
+
```
|
189
|
+
|
190
|
+
|
152
191
|
### Guards
|
153
192
|
|
154
193
|
Let's assume you want to allow particular transitions only if a defined condition is
|
@@ -190,6 +229,24 @@ job.may_sleep? # => false
|
|
190
229
|
job.sleep # => raises AASM::InvalidTransition
|
191
230
|
```
|
192
231
|
|
232
|
+
You can even provide a number of guards, which all have to succeed to proceed
|
233
|
+
|
234
|
+
```ruby
|
235
|
+
def walked_the_dog?; ...; end
|
236
|
+
|
237
|
+
event :sleep do
|
238
|
+
transitions :from => :running, :to => :sleeping, :guards => [:cleaning_needed?, :walked_the_dog?]
|
239
|
+
end
|
240
|
+
```
|
241
|
+
|
242
|
+
If you want to provide guards for all transitions within an event, you can use event guards
|
243
|
+
|
244
|
+
```ruby
|
245
|
+
event :sleep, :guards => [:walked_the_dog?] do
|
246
|
+
transitions :from => :running, :to => :sleeping, :guards => [:cleaning_needed?]
|
247
|
+
transitions :from => :cleaning, :to => :sleeping
|
248
|
+
end
|
249
|
+
```
|
193
250
|
|
194
251
|
### ActiveRecord
|
195
252
|
|
@@ -248,6 +305,57 @@ class Job < ActiveRecord::Base
|
|
248
305
|
end
|
249
306
|
```
|
250
307
|
|
308
|
+
#### ActiveRecord enums
|
309
|
+
|
310
|
+
You can use
|
311
|
+
[enumerations](http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html)
|
312
|
+
in Rails 4.1+ for your state column:
|
313
|
+
|
314
|
+
```ruby
|
315
|
+
class Job < ActiveRecord::Base
|
316
|
+
include AASM
|
317
|
+
|
318
|
+
enum state: {
|
319
|
+
sleeping: 5,
|
320
|
+
running: 99
|
321
|
+
}
|
322
|
+
|
323
|
+
aasm :column => :state, :enum => true do
|
324
|
+
state :sleeping, :initial => true
|
325
|
+
state :running
|
326
|
+
end
|
327
|
+
end
|
328
|
+
```
|
329
|
+
|
330
|
+
You can explicitly pass the name of the method which provides access
|
331
|
+
to the enumeration mapping as a value of ```enum```, or you can simply
|
332
|
+
set it to ```true```. In the latter case AASM will try to use
|
333
|
+
pluralized column name to access possible enum states.
|
334
|
+
|
335
|
+
Furthermore, if your column has integer type (which is normally the
|
336
|
+
case when you're working with Rails enums), you can omit ```:enum```
|
337
|
+
setting --- AASM auto-detects this situation and enabled enum
|
338
|
+
support. If anything goes wrong, you can disable enum functionality
|
339
|
+
and fall back to the default behavior by setting ```:enum```
|
340
|
+
to ```false```.
|
341
|
+
|
342
|
+
### Sequel
|
343
|
+
|
344
|
+
AASM also supports [Sequel](http://sequel.jeremyevans.net/) besides _ActiveRecord_ and _Mongoid_.
|
345
|
+
|
346
|
+
```ruby
|
347
|
+
class Job < Sequel::Model
|
348
|
+
include AASM
|
349
|
+
|
350
|
+
aasm do # default column: aasm_state
|
351
|
+
...
|
352
|
+
end
|
353
|
+
end
|
354
|
+
```
|
355
|
+
|
356
|
+
However it's not yet as feature complete as _ActiveRecord_. For example, there are
|
357
|
+
scopes defined yet. See [Automatic Scopes](#automatic-scopes).
|
358
|
+
|
251
359
|
### Mongoid
|
252
360
|
|
253
361
|
AASM also supports persistence to Mongodb if you're using Mongoid. Make sure
|
@@ -257,6 +365,7 @@ to include Mongoid::Document before you include AASM.
|
|
257
365
|
class Job
|
258
366
|
include Mongoid::Document
|
259
367
|
include AASM
|
368
|
+
field :aasm_state
|
260
369
|
aasm do
|
261
370
|
...
|
262
371
|
end
|
@@ -277,7 +386,7 @@ class Job < ActiveRecord::Base
|
|
277
386
|
state :cleaning
|
278
387
|
end
|
279
388
|
|
280
|
-
def sleeping
|
389
|
+
def self.sleeping
|
281
390
|
"This method name is in already use"
|
282
391
|
end
|
283
392
|
end
|
@@ -286,10 +395,10 @@ end
|
|
286
395
|
```ruby
|
287
396
|
class JobsController < ApplicationController
|
288
397
|
def index
|
289
|
-
@running_jobs =
|
290
|
-
@recent_cleaning_jobs =
|
398
|
+
@running_jobs = Job.running
|
399
|
+
@recent_cleaning_jobs = Job.cleaning.where('created_at >= ?', 3.days.ago)
|
291
400
|
|
292
|
-
# @sleeping_jobs =
|
401
|
+
# @sleeping_jobs = Job.sleeping #=> "This method name is in already use"
|
293
402
|
end
|
294
403
|
end
|
295
404
|
```
|
@@ -325,9 +434,9 @@ class Job < ActiveRecord::Base
|
|
325
434
|
|
326
435
|
aasm do
|
327
436
|
state :sleeping, :initial => true
|
328
|
-
state :running
|
437
|
+
state :running, :after_commit => :notify_about_running_job
|
329
438
|
|
330
|
-
event :run
|
439
|
+
event :run do
|
331
440
|
transitions :from => :sleeping, :to => :running
|
332
441
|
end
|
333
442
|
end
|
@@ -338,6 +447,28 @@ class Job < ActiveRecord::Base
|
|
338
447
|
end
|
339
448
|
```
|
340
449
|
|
450
|
+
If you want to encapsulate state changes within an own transaction, the behavior
|
451
|
+
of this nested transaction might be confusing. Take a look at
|
452
|
+
[ActiveRecord Nested Transactions](http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html)
|
453
|
+
if you want to know more about this. Nevertheless, AASM by default requires a new transaction
|
454
|
+
`transaction(:requires_new => true)`. You can override this behavior by changing
|
455
|
+
the configuration
|
456
|
+
|
457
|
+
```ruby
|
458
|
+
class Job < ActiveRecord::Base
|
459
|
+
include AASM
|
460
|
+
|
461
|
+
aasm :requires_new_transaction => false do
|
462
|
+
...
|
463
|
+
end
|
464
|
+
|
465
|
+
...
|
466
|
+
end
|
467
|
+
```
|
468
|
+
|
469
|
+
which then leads to `transaction(:requires_new => false)`, the Rails default.
|
470
|
+
|
471
|
+
|
341
472
|
### Column name & migration
|
342
473
|
|
343
474
|
As a default AASM uses the column `aasm_state` to store the states. You can override
|
@@ -378,13 +509,13 @@ Given the `Job` class from above:
|
|
378
509
|
```ruby
|
379
510
|
job = Job.new
|
380
511
|
|
381
|
-
job.aasm.states
|
512
|
+
job.aasm.states.map(&:name)
|
382
513
|
=> [:sleeping, :running, :cleaning]
|
383
514
|
|
384
|
-
job.aasm.states(:permissible => true)
|
515
|
+
job.aasm.states(:permissible => true).map(&:name)
|
385
516
|
=> [:running]
|
386
517
|
job.run
|
387
|
-
job.aasm.states(:permissible => true)
|
518
|
+
job.aasm.states(:permissible => true).map(&:name)
|
388
519
|
=> [:cleaning, :sleeping]
|
389
520
|
|
390
521
|
job.aasm.events
|
@@ -417,7 +548,7 @@ gem 'aasm'
|
|
417
548
|
|
418
549
|
## Latest changes ##
|
419
550
|
|
420
|
-
|
551
|
+
Take a look at the [CHANGELOG](https://github.com/aasm/aasm/blob/master/CHANGELOG.md) for details about recent changes to the current version.
|
421
552
|
|
422
553
|
## Questions? ##
|
423
554
|
|
@@ -427,11 +558,11 @@ Feel free to
|
|
427
558
|
* [ask a question on StackOverflow](http://stackoverflow.com) (tag with `aasm`)
|
428
559
|
* send us a tweet [@aasm](http://twitter.com/aasm)
|
429
560
|
|
430
|
-
##
|
561
|
+
## Maintainers ##
|
431
562
|
|
432
|
-
* [Scott Barron](https://github.com/rubyist)
|
433
|
-
* [Travis Tilley](https://github.com/ttilley)
|
434
|
-
* [Thorsten Böttger](http://github.com/alto)
|
563
|
+
* [Scott Barron](https://github.com/rubyist) (2006–2009, original author)
|
564
|
+
* [Travis Tilley](https://github.com/ttilley) (2009–2011)
|
565
|
+
* [Thorsten Böttger](http://github.com/alto) (since 2011)
|
435
566
|
|
436
567
|
|
437
568
|
## Warranty ##
|
@@ -443,7 +574,7 @@ purpose.
|
|
443
574
|
|
444
575
|
## License ##
|
445
576
|
|
446
|
-
Copyright (c) 2006-
|
577
|
+
Copyright (c) 2006-2014 Scott Barron
|
447
578
|
|
448
579
|
Permission is hereby granted, free of charge, to any person obtaining
|
449
580
|
a copy of this software and associated documentation files (the
|
data/aasm.gemspec
CHANGED
@@ -5,7 +5,7 @@ require "aasm/version"
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "aasm"
|
7
7
|
s.version = AASM::VERSION
|
8
|
-
s.authors = ["Scott Barron", "
|
8
|
+
s.authors = ["Scott Barron", "Travis Tilley", "Thorsten Boettger"]
|
9
9
|
s.email = %q{scott@elitists.net, ttilley@gmail.com, aasm@mt7.de}
|
10
10
|
s.homepage = %q{https://github.com/aasm/aasm}
|
11
11
|
s.summary = %q{State machine mixin for Ruby objects}
|
@@ -13,22 +13,21 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.date = Time.now
|
14
14
|
s.licenses = ["MIT"]
|
15
15
|
|
16
|
-
s.add_development_dependency 'activerecord', '3.2.15'
|
16
|
+
# s.add_development_dependency 'activerecord', '3.2.15'
|
17
17
|
# s.add_development_dependency 'activerecord', '4.0.1'
|
18
18
|
|
19
|
-
s.add_development_dependency 'mongoid' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3')
|
19
|
+
# s.add_development_dependency 'mongoid' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3')
|
20
20
|
s.add_development_dependency 'rake'
|
21
21
|
s.add_development_dependency 'sdoc'
|
22
22
|
s.add_development_dependency 'rspec', '~> 2.14'
|
23
23
|
s.add_development_dependency 'rr'
|
24
|
-
s.add_development_dependency 'sqlite3'
|
24
|
+
# s.add_development_dependency 'sqlite3'
|
25
25
|
s.add_development_dependency 'minitest'
|
26
26
|
# s.add_development_dependency 'debugger'
|
27
27
|
# s.add_development_dependency 'pry'
|
28
|
-
s.add_development_dependency 'ruby-debug-completion'
|
29
28
|
|
30
29
|
s.add_development_dependency 'mime-types', '~> 1.25' # needed by coveralls (>= 2.0 needs Ruby >=1.9.2)
|
31
|
-
s.add_development_dependency 'coveralls'
|
30
|
+
# s.add_development_dependency 'coveralls'
|
32
31
|
|
33
32
|
s.files = `git ls-files`.split("\n")
|
34
33
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -0,0 +1,13 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gem "sqlite3", :platforms => :ruby
|
4
|
+
gem "coveralls"
|
5
|
+
gem 'rubysl', :platforms => :rbx
|
6
|
+
gem 'rubinius-developer_tools', :platforms => :rbx
|
7
|
+
gem "jruby-openssl", :platforms => :jruby
|
8
|
+
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
9
|
+
gem "rails", "3.2.18"
|
10
|
+
gem 'mongoid' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3')
|
11
|
+
gem 'sequel'
|
12
|
+
|
13
|
+
gemspec :path => "../"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gem "sqlite3", :platforms => :ruby
|
4
|
+
gem "coveralls"
|
5
|
+
gem 'rubysl', :platforms => :rbx
|
6
|
+
gem 'rubinius-developer_tools', :platforms => :rbx
|
7
|
+
gem "jruby-openssl", :platforms => :jruby
|
8
|
+
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
9
|
+
gem "rails", "4.0.5"
|
10
|
+
|
11
|
+
# mongoid is not yet compatible with Rails >= 4
|
12
|
+
# gem 'mongoid' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3')
|
13
|
+
|
14
|
+
gem 'sequel'
|
15
|
+
|
16
|
+
gemspec :path => "../"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gem "sqlite3", :platforms => :ruby
|
4
|
+
gem "coveralls"
|
5
|
+
gem 'rubysl', :platforms => :rbx
|
6
|
+
gem 'rubinius-developer_tools', :platforms => :rbx
|
7
|
+
gem "jruby-openssl", :platforms => :jruby
|
8
|
+
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
9
|
+
gem "rails", "4.1.1"
|
10
|
+
|
11
|
+
# mongoid is not yet compatible with Rails >= 4
|
12
|
+
# gem 'mongoid' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3')
|
13
|
+
|
14
|
+
gem 'sequel'
|
15
|
+
|
16
|
+
gemspec :path => "../"
|