aasm 4.12.3 → 5.0.1

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.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +14 -12
  3. data/Appraisals +39 -16
  4. data/CHANGELOG.md +16 -3
  5. data/Dockerfile +44 -0
  6. data/Gemfile +1 -2
  7. data/README.md +41 -11
  8. data/docker-compose.yml +40 -0
  9. data/gemfiles/rails_3.2.gemfile +6 -6
  10. data/gemfiles/rails_4.0.gemfile +7 -7
  11. data/gemfiles/rails_4.2.gemfile +8 -8
  12. data/gemfiles/rails_4.2_mongoid_5.gemfile +5 -5
  13. data/gemfiles/rails_4.2_nobrainer.gemfile +9 -0
  14. data/gemfiles/rails_5.0.gemfile +5 -6
  15. data/gemfiles/rails_5.0_nobrainer.gemfile +9 -0
  16. data/gemfiles/rails_5.1.gemfile +13 -0
  17. data/lib/aasm.rb +5 -0
  18. data/lib/aasm/aasm.rb +1 -0
  19. data/lib/aasm/core/event.rb +6 -21
  20. data/lib/aasm/core/invoker.rb +129 -0
  21. data/lib/aasm/core/invokers/base_invoker.rb +75 -0
  22. data/lib/aasm/core/invokers/class_invoker.rb +52 -0
  23. data/lib/aasm/core/invokers/literal_invoker.rb +47 -0
  24. data/lib/aasm/core/invokers/proc_invoker.rb +59 -0
  25. data/lib/aasm/core/state.rb +10 -9
  26. data/lib/aasm/core/transition.rb +7 -68
  27. data/lib/aasm/errors.rb +2 -2
  28. data/lib/aasm/persistence.rb +3 -0
  29. data/lib/aasm/persistence/active_record_persistence.rb +5 -4
  30. data/lib/aasm/persistence/no_brainer_persistence.rb +105 -0
  31. data/lib/aasm/persistence/plain_persistence.rb +2 -1
  32. data/lib/aasm/persistence/sequel_persistence.rb +0 -1
  33. data/lib/aasm/rspec/allow_event.rb +5 -1
  34. data/lib/aasm/rspec/allow_transition_to.rb +5 -1
  35. data/lib/aasm/version.rb +1 -1
  36. data/lib/generators/nobrainer/aasm_generator.rb +28 -0
  37. data/lib/motion-aasm.rb +1 -0
  38. data/spec/database.rb +3 -0
  39. data/spec/generators/no_brainer_generator_spec.rb +29 -0
  40. data/spec/models/active_record/simple_new_dsl.rb +15 -0
  41. data/spec/models/nobrainer/complex_no_brainer_example.rb +36 -0
  42. data/spec/models/nobrainer/invalid_persistor_no_brainer.rb +39 -0
  43. data/spec/models/nobrainer/no_scope_no_brainer.rb +21 -0
  44. data/spec/models/nobrainer/nobrainer_relationships.rb +25 -0
  45. data/spec/models/nobrainer/silent_persistor_no_brainer.rb +39 -0
  46. data/spec/models/nobrainer/simple_new_dsl_nobrainer.rb +25 -0
  47. data/spec/models/nobrainer/simple_no_brainer.rb +23 -0
  48. data/spec/models/nobrainer/validator_no_brainer.rb +98 -0
  49. data/spec/models/simple_example.rb +2 -0
  50. data/spec/models/simple_example_with_guard_args.rb +17 -0
  51. data/spec/spec_helpers/active_record.rb +2 -1
  52. data/spec/spec_helpers/dynamoid.rb +7 -5
  53. data/spec/spec_helpers/mongoid.rb +20 -1
  54. data/spec/spec_helpers/nobrainer.rb +15 -0
  55. data/spec/spec_helpers/redis.rb +5 -2
  56. data/spec/spec_helpers/sequel.rb +1 -1
  57. data/spec/unit/callback_multiple_spec.rb +3 -3
  58. data/spec/unit/callbacks_spec.rb +2 -2
  59. data/spec/unit/exception_spec.rb +1 -1
  60. data/spec/unit/invoker_spec.rb +189 -0
  61. data/spec/unit/invokers/base_invoker_spec.rb +72 -0
  62. data/spec/unit/invokers/class_invoker_spec.rb +95 -0
  63. data/spec/unit/invokers/literal_invoker_spec.rb +86 -0
  64. data/spec/unit/invokers/proc_invoker_spec.rb +86 -0
  65. data/spec/unit/persistence/active_record_persistence_spec.rb +16 -0
  66. data/spec/unit/persistence/mongoid_persistence_multiple_spec.rb +0 -4
  67. data/spec/unit/persistence/mongoid_persistence_spec.rb +0 -4
  68. data/spec/unit/persistence/no_brainer_persistence_multiple_spec.rb +198 -0
  69. data/spec/unit/persistence/no_brainer_persistence_spec.rb +158 -0
  70. data/spec/unit/rspec_matcher_spec.rb +6 -0
  71. data/spec/unit/state_spec.rb +2 -2
  72. data/spec/unit/transition_spec.rb +1 -1
  73. data/test/minitest_helper.rb +2 -2
  74. data/test/unit/minitest_matcher_test.rb +1 -1
  75. metadata +51 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 485dd737c1e66c6abf9ad6beec5b88610e282cf5
4
- data.tar.gz: dc4e4de44fbb182924bc28b13aff6708766f2cfc
3
+ metadata.gz: ea455b8d666bb3c526bec4b9be0736719a3b38a5
4
+ data.tar.gz: 3987011c8c53b930f369f76399b37194966bd170
5
5
  SHA512:
6
- metadata.gz: 8211acf5c307b6c04b04ff0aad09aecece63d8df1fc6dbe3de14e363ab415a1e0291510b2d4783cf9cd22391415a25e4ac72d7f43f35ea612b60f939ab6def2a
7
- data.tar.gz: a95bd160171a94dfc8ac1a4de0594372c336cf546f38727cacc95ca73af43369419bc6b3637634faa02b7eae6b8c668d29c5b74a5eb930aba4a03af190f8364a
6
+ metadata.gz: b35a314d950405db70775b44f8cb06617d5b4987d1f07e586069e19dcab525e761d71551019c53340b622733a8600de5ce238a44cf685854801696203cdda4d0
7
+ data.tar.gz: 3852368590562313ea46427efb3c41d1f414c9a379e522880d7af472807014350a109ab65c2ebe445dbbd6132cee531375e20bb0fd36a83eea425d4cf054d377
data/.travis.yml CHANGED
@@ -3,22 +3,26 @@ language: ruby
3
3
  cache: bundler
4
4
 
5
5
  rvm:
6
- - 1.9.3
7
6
  - 2.2.6
8
7
  - 2.3.3
9
- - jruby-1.7 # JRuby in 1.9 mode
10
- - jruby-9.0.5.0
8
+ - jruby-9.1.12.0
11
9
 
12
10
  services:
13
11
  - mongodb
14
12
  - redis-server
15
13
 
14
+ addons:
15
+ rethinkdb: '2.3.6'
16
+
16
17
  gemfile:
17
18
  - gemfiles/rails_3.2.gemfile
18
19
  - gemfiles/rails_4.0.gemfile
19
20
  - gemfiles/rails_4.2.gemfile
20
21
  - gemfiles/rails_4.2_mongoid_5.gemfile
22
+ - gemfiles/rails_4.2_nobrainer.gemfile
21
23
  - gemfiles/rails_5.0.gemfile
24
+ - gemfiles/rails_5.0_nobrainer.gemfile
25
+ - gemfiles/rails_5.1.gemfile
22
26
 
23
27
  before_script:
24
28
  - mkdir /tmp/dynamodb
@@ -32,20 +36,18 @@ script:
32
36
 
33
37
  matrix:
34
38
  exclude:
35
- - rvm: 1.9.3
36
- gemfile: gemfiles/rails_4.2_mongoid_5.gemfile
37
- - rvm: 1.9.3
38
- gemfile: gemfiles/rails_5.0.gemfile
39
39
  - rvm: 2.2.6
40
40
  gemfile: gemfiles/rails_3.2.gemfile
41
41
  - rvm: 2.3.3
42
42
  gemfile: gemfiles/rails_3.2.gemfile
43
- - rvm: jruby-1.7
44
- gemfile: gemfiles/rails_4.2_mongoid_5.gemfile
45
- - rvm: jruby-1.7
46
- gemfile: gemfiles/rails_5.0.gemfile
47
- - rvm: jruby-9.0.5.0
43
+ - rvm: jruby-9.1.12.0
48
44
  gemfile: gemfiles/rails_5.0.gemfile
45
+ - rvm: jruby-9.1.12.0
46
+ gemfile: gemfiles/rails_5.1.gemfile
47
+ - rvm: jruby-9.1.12.0
48
+ gemfile: gemfiles/rails_4.2_nobrainer.gemfile
49
+ - rvm: jruby-9.1.12.0
50
+ gemfile: gemfiles/rails_5.0_nobrainer.gemfile
49
51
 
50
52
  notifications:
51
53
  slack:
data/Appraisals CHANGED
@@ -1,43 +1,66 @@
1
1
  appraise 'rails_3.2' do
2
- gem 'rails', '~>3.2.22'
3
- gem 'mongoid', '~>3.1'
2
+ gem 'rails', '~> 3.2.22'
3
+ gem 'mongoid', '~> 3.1'
4
4
  gem 'sequel'
5
- gem 'bson_ext', :platforms => :ruby
5
+ gem 'bson_ext', platforms: :ruby
6
6
  gem 'test-unit', '~> 3.0'
7
+ gem 'activerecord-jdbcsqlite3-adapter', '1.3.24', platforms: :jruby
7
8
  end
8
9
 
9
10
  appraise 'rails_4.0' do
10
- gem 'mime-types', '~> 2', :platforms => [:ruby_19, :jruby]
11
+ gem 'mime-types', '~> 2', platforms: %i[ruby_19 jruby]
11
12
  gem 'rails', '4.0.13'
12
- gem 'mongoid', '~>4.0'
13
+ gem 'mongoid', '~> 4.0'
13
14
  gem 'sequel'
14
- gem 'dynamoid', '~> 1', :platforms => :ruby
15
- gem 'aws-sdk', '~>2', :platforms => :ruby
15
+ gem 'dynamoid', '~> 1', platforms: :ruby
16
+ gem 'aws-sdk', '~> 2', platforms: :ruby
16
17
  gem 'redis-objects'
18
+ gem 'activerecord-jdbcsqlite3-adapter', '1.3.24', platforms: :jruby
17
19
  end
18
20
 
19
21
  appraise 'rails_4.2' do
20
- gem 'nokogiri', '1.6.8.1', :platforms => [:ruby_19]
21
- gem 'mime-types', '~> 2', :platforms => [:ruby_19, :jruby]
22
+ gem 'nokogiri', '1.6.8.1', platforms: %i[ruby_19]
23
+ gem 'mime-types', '~> 2', platforms: %i[ruby_19 jruby]
22
24
  gem 'rails', '4.2.5'
23
- gem 'mongoid', '~>4.0'
25
+ gem 'mongoid', '~> 4.0'
24
26
  gem 'sequel'
25
- gem 'dynamoid', '~> 1', :platforms => :ruby
26
- gem 'aws-sdk', '~>2', :platforms => :ruby
27
+ gem 'dynamoid', '~> 1', platforms: :ruby
28
+ gem 'aws-sdk', '~> 2', platforms: :ruby
27
29
  gem 'redis-objects'
30
+ gem 'activerecord-jdbcsqlite3-adapter', '1.3.24', platforms: :jruby
31
+ end
32
+
33
+ appraise 'rails_4.2_nobrainer' do
34
+ gem 'rails', '4.2.5'
35
+ gem 'nobrainer', '~> 0.33.0'
28
36
  end
29
37
 
30
38
  appraise 'rails_4.2_mongoid_5' do
31
- gem 'mime-types', '~> 2', :platforms => [:ruby_19, :jruby]
39
+ gem 'mime-types', '~> 2', platforms: %i[ruby_19 jruby]
32
40
  gem 'rails', '4.2.5'
33
- gem 'mongoid', '~>5.0'
41
+ gem 'mongoid', '~> 5.0'
42
+ gem 'activerecord-jdbcsqlite3-adapter', '1.3.24', platforms: :jruby
34
43
  end
35
44
 
36
45
  appraise 'rails_5.0' do
37
46
  gem 'rails', '5.0.0'
47
+ gem 'mongoid', '~> 6.0'
48
+ gem 'sequel'
49
+ gem 'dynamoid', '~> 1', platforms: :ruby
50
+ gem 'aws-sdk', '~> 2', platforms: :ruby
51
+ gem 'redis-objects'
52
+ end
53
+
54
+ appraise 'rails_5.0_nobrainer' do
55
+ gem 'rails', '5.0.0'
56
+ gem 'nobrainer', '~> 0.33.0'
57
+ end
58
+
59
+ appraise 'rails_5.1' do
60
+ gem 'rails', '5.1'
38
61
  gem 'mongoid', '~>6.0'
39
62
  gem 'sequel'
40
- gem 'dynamoid', '~> 1', :platforms => :ruby
41
- gem 'aws-sdk', '~>2', :platforms => :ruby
63
+ gem 'dynamoid', '~> 1', platforms: :ruby
64
+ gem 'aws-sdk', '~>2', platforms: :ruby
42
65
  gem 'redis-objects'
43
66
  end
data/CHANGELOG.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # CHANGELOG
2
2
 
3
3
  ## unreleased
4
+
5
+ ## 5.0.1
6
+
7
+ * Fix failures array in transition not being reset [#383](https://github.com/aasm/aasm/issues/383)
8
+ * Enable AASM scopes to be defined on abstract classes.
9
+
10
+ ## 5.0.0
11
+
12
+ * Chore(invokers): Refactor callback invokers, add class-callbacks support [#541](https://github.com/aasm/aasm/pull/541), thanks to [pandomic](https://github.com/pandomic)
13
+ * Add docker setup to readme
14
+ * Add support for Nobrainer (RethinkDB) [#522](https://github.com/aasm/aasm/pull/522), thanks to [zedtux](https://github.com/zedtux)
15
+ * Patch `allow_event` to accept event with custom arguments [#419](https://github.com/aasm/aasm/pull/419), thanks to [czhc](https://github.com/czhc)
16
+
4
17
  ## 4.12.3
5
18
 
6
19
  * Add to AASM fire(event) and fire!(event) methods [#494](https://github.com/aasm/aasm/pull/494), thanks to [slayer](https://github.com/slayer)
@@ -14,9 +27,9 @@
14
27
 
15
28
  ## 4.12.1
16
29
 
17
- * DRY-up Mongoid and ActiveRecord Persistence, Add Sequel transactions and locking [#475](https://github.com/aasm/aasm/pull/475), thanks to [@Aryk] (https://github.com/Aryk)
18
- * Add aliases for event methods [#476](https://github.com/aasm/aasm/pull/476), thanks to [@Aryk] (https://github.com/Aryk)
19
- * Support Minitest spec expectations [#387](https://github.com/aasm/aasm/pull/387), thanks to [@faragorn] (https://github.com/faragorn)
30
+ * DRY-up Mongoid and ActiveRecord Persistence, Add Sequel transactions and locking [#475](https://github.com/aasm/aasm/pull/475), thanks to [@Aryk](https://github.com/Aryk)
31
+ * Add aliases for event methods [#476](https://github.com/aasm/aasm/pull/476), thanks to [@Aryk](https://github.com/Aryk)
32
+ * Support Minitest spec expectations [#387](https://github.com/aasm/aasm/pull/387), thanks to [@faragorn](https://github.com/faragorn)
20
33
  ## 4.12.0
21
34
 
22
35
  * Fix thread safe issue with concurrent-ruby gem [see [pull-request #422](https://github.com/aasm/aasm/pull/442), thanks to [@reidmorrison](https://github.com/reidmorrison)
data/Dockerfile ADDED
@@ -0,0 +1,44 @@
1
+ FROM ruby:2.3.4-slim
2
+
3
+ LABEL maintainer="AASM"
4
+
5
+ ENV DEBIAN_FRONTEND noninteractive
6
+
7
+ # ~~~~ System locales ~~~~
8
+ RUN apt-get update && apt-get install -y locales && \
9
+ dpkg-reconfigure locales && \
10
+ locale-gen C.UTF-8 && \
11
+ /usr/sbin/update-locale LANG=C.UTF-8 && \
12
+ echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && \
13
+ locale-gen
14
+
15
+ # Set default locale for the environment
16
+ ENV LC_ALL C.UTF-8
17
+ ENV LANG en_US.UTF-8
18
+ ENV LANGUAGE en_US.UTF-8
19
+ ENV APP_HOME /application
20
+
21
+ # ~~~~ Application dependencies ~~~~
22
+ RUN apt-get update
23
+ RUN apt-get install -y libsqlite3-dev \
24
+ build-essential \
25
+ git
26
+
27
+ # ~~~~ Bundler ~~~~
28
+ RUN gem install bundler
29
+
30
+ WORKDIR $APP_HOME
31
+ RUN mkdir -p $APP_HOME/lib/aasm/
32
+
33
+ COPY Gemfile* $APP_HOME/
34
+ COPY *.gemspec $APP_HOME/
35
+ COPY lib/aasm/version.rb $APP_HOME/lib/aasm/
36
+
37
+ ENV BUNDLE_GEMFILE=$APP_HOME/Gemfile \
38
+ BUNDLE_JOBS=8 \
39
+ BUNDLE_PATH=/bundle
40
+
41
+ RUN bundle install
42
+
43
+ # ~~~~ Import application ~~~~
44
+ COPY . $APP_HOME
data/Gemfile CHANGED
@@ -3,5 +3,4 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  gem 'sqlite3', :platforms => :ruby
6
- gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
7
- gem 'rails', '5.1.3'
6
+ gem 'rails', '5.1.4'
data/README.md CHANGED
@@ -24,6 +24,7 @@
24
24
  - [Sequel](#sequel)
25
25
  - [Dynamoid](#dynamoid)
26
26
  - [Mongoid](#mongoid)
27
+ - [Nobrainer](#nobrainer)
27
28
  - [Redis](#redis)
28
29
  - [Automatic Scopes](#automatic-scopes)
29
30
  - [Transaction support](#transaction-support)
@@ -42,6 +43,7 @@
42
43
  - [Bundler](#or-if-you-are-using-bundler)
43
44
  - [Building your own gems](#building-your-own-gems)
44
45
  - [Generators](#generators)
46
+ - [Test suite with Docker](#docker)
45
47
  - [Latest changes](#latest-changes)
46
48
  - [Questions?](#questions)
47
49
  - [Maintainers](#maintainers)
@@ -52,10 +54,8 @@
52
54
  This package contains AASM, a library for adding finite state machines to Ruby classes.
53
55
 
54
56
  AASM started as the *acts_as_state_machine* plugin but has evolved into a more generic library
55
- that no longer targets only ActiveRecord models. It currently provides adapters for
56
- [ActiveRecord](http://api.rubyonrails.org/classes/ActiveRecord/Base.html),
57
- and [Mongoid](http://mongoid.org/) but it can be used for any Ruby class, no matter what
58
- parent class it has (if any).
57
+ that no longer targets only ActiveRecord models. It currently provides adapters for many
58
+ ORMs but it can be used for any Ruby class, no matter what parent class it has (if any).
59
59
 
60
60
  ## Upgrade from version 3 to 4
61
61
 
@@ -130,8 +130,8 @@ the transition succeeds :
130
130
 
131
131
  ### Callbacks
132
132
 
133
- You can define a number of callbacks for your transitions. These methods will be
134
- called, when certain criteria are met, like entering a particular state:
133
+ You can define a number of callbacks for your events, transitions and states. These methods, Procs or classes will be
134
+ called when certain criteria are met, like entering a particular state:
135
135
 
136
136
  ```ruby
137
137
  class Job
@@ -139,7 +139,7 @@ class Job
139
139
 
140
140
  aasm do
141
141
  state :sleeping, :initial => true, :before_enter => :do_something
142
- state :running
142
+ state :running, before_enter: Proc.new { do_something && notify_somebody }
143
143
  state :finished
144
144
 
145
145
  after_all_transitions :log_status_change
@@ -195,6 +195,8 @@ is finished.
195
195
 
196
196
  AASM will also initialize `LogRunTime` and run the `call` method for you after the transition from `running` to `finished` in the example above. You can pass arguments to the class by defining an initialize method on it, like this:
197
197
 
198
+ Note that Procs are executed in the context of a record, it means that you don't need to expect the record as an argument, just call the methods you need.
199
+
198
200
  ```ruby
199
201
  class LogRunTime
200
202
  # optional args parameter can be omitted, but if you define initialize
@@ -225,7 +227,7 @@ callback, which can handle it or re-raise it for further propagation.
225
227
 
226
228
  Also, you can define a method that will be called if any event fails:
227
229
 
228
- ```
230
+ ```ruby
229
231
  def aasm_event_failed(event_name, old_state_name)
230
232
  # use custom exception/messages, report metrics, etc
231
233
  end
@@ -523,7 +525,7 @@ All _AASM_ class- and instance-level `aasm` methods accept a state machine selec
523
525
  So, for example, to use inspection on a class level, you have to use
524
526
 
525
527
  ```ruby
526
- SimpleMultipleExample.aasm(:work).states
528
+ SimpleMultipleExample.aasm(:move).states.map(&:name)
527
529
  # => [:standing, :walking, :running]
528
530
  ```
529
531
 
@@ -630,7 +632,7 @@ class CustomAASMBase < AASM::Base
630
632
  end
631
633
  ```
632
634
 
633
- When we declare our model that has an AASM state machine, we simply declare the AASM block with a `:with` key to our own class.
635
+ When we declare our model that has an AASM state machine, we simply declare the AASM block with a `:with_klass` key to our own class.
634
636
 
635
637
  ```ruby
636
638
  class SimpleCustomExample
@@ -825,6 +827,23 @@ class Job
825
827
  end
826
828
  ```
827
829
 
830
+ ### NoBrainer
831
+
832
+ AASM also supports persistence to [RethinkDB](https://www.rethinkdb.com/)
833
+ if you're using [Nobrainer](http://nobrainer.io/).
834
+ Make sure to include NoBrainer::Document before you include AASM.
835
+
836
+ ```ruby
837
+ class Job
838
+ include NoBrainer::Document
839
+ include AASM
840
+ field :aasm_state
841
+ aasm do
842
+ ...
843
+ end
844
+ end
845
+ ```
846
+
828
847
  ### Redis
829
848
 
830
849
  AASM also supports persistence in Redis via
@@ -1193,6 +1212,9 @@ expect(multiple).to allow_event(:start).on(:move)
1193
1212
  expect(multiple).to_not allow_event(:stop).on(:move)
1194
1213
  expect(multiple).to allow_transition_to(:processing).on(:move)
1195
1214
  expect(multiple).to_not allow_transition_to(:sleeping).on(:move)
1215
+ # allow_event also accepts arguments
1216
+ expect(job).to allow_event(:run).with(:defragmentation)
1217
+
1196
1218
  ```
1197
1219
 
1198
1220
  #### Minitest
@@ -1203,7 +1225,7 @@ AASM provides assertions and rspec-like expectations for [Minitest](https://gith
1203
1225
 
1204
1226
  List of supported assertions: `assert_have_state`, `refute_have_state`, `assert_transitions_from`, `refute_transitions_from`, `assert_event_allowed`, `refute_event_allowed`, `assert_transition_to_allowed`, `refute_transition_to_allowed`.
1205
1227
 
1206
- Add `require 'aasm/minitest' to your `test_helper.rb` file and use them like this:
1228
+ Add `require 'aasm/minitest'` to your `test_helper.rb` file and use them like this:
1207
1229
 
1208
1230
  ```ruby
1209
1231
  # classes with only the default state machine
@@ -1312,6 +1334,14 @@ Replace NAME with the Model name, COLUMN_NAME is optional(default is 'aasm_state
1312
1334
  This will create a model (if one does not exist) and configure it with aasm block.
1313
1335
  For Active record orm a migration file is added to add aasm state column to table.
1314
1336
 
1337
+ ### Docker
1338
+
1339
+ Run test suite easily on docker
1340
+ ```
1341
+ 1. docker-compose build aasm
1342
+ 2. docker-compose run --rm aasm
1343
+ ```
1344
+
1315
1345
  ## Latest changes ##
1316
1346
 
1317
1347
  Take a look at the [CHANGELOG](https://github.com/aasm/aasm/blob/master/CHANGELOG.md) for details about recent changes to the current version.
@@ -0,0 +1,40 @@
1
+ version: "2"
2
+
3
+ services:
4
+ aasm:
5
+ image: aasm/aasm
6
+ build: .
7
+ command: bash -c 'bundle exec appraisal install && bundle exec appraisal rspec'
8
+ environment:
9
+ - DYNAMODB_HOST=dynamodb
10
+ - DYNAMODB_PORT=8000
11
+ - MONGODB_HOST=mongo
12
+ - MONGODB_PORT=27017
13
+ - RAILS_ENV=development
14
+ - REDIS_HOST=redis
15
+ - REDIS_PORT=6379
16
+ - RETHINKDB_DB=rethinkdb_test
17
+ - RETHINKDB_HOST=rethinkdb
18
+ - RETHINKDB_PORT=28015
19
+ depends_on:
20
+ - dynamodb
21
+ - mongo
22
+ - redis
23
+ - rethinkdb
24
+ volumes:
25
+ - .:/application
26
+ volumes_from:
27
+ - bundle
28
+ bundle:
29
+ image: aasm/aasm
30
+ command: echo Bundler data container
31
+ volumes:
32
+ - /bundle
33
+ dynamodb:
34
+ image: cnadiminti/dynamodb-local:2017-02-16
35
+ mongo:
36
+ image: mongo:3.6.1
37
+ redis:
38
+ image: redis:4.0.6-alpine
39
+ rethinkdb:
40
+ image: rethinkdb:2.3.6
@@ -2,12 +2,12 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3", :platforms => :ruby
6
- gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
7
- gem "rails", "~>3.2.22"
8
- gem "mongoid", "~>3.1"
5
+ gem "sqlite3", platforms: :ruby
6
+ gem "rails", "~> 3.2.22"
7
+ gem "mongoid", "~> 3.1"
9
8
  gem "sequel"
10
- gem "bson_ext", :platforms => :ruby
9
+ gem "bson_ext", platforms: :ruby
11
10
  gem "test-unit", "~> 3.0"
11
+ gem "activerecord-jdbcsqlite3-adapter", "1.3.24", platforms: :jruby
12
12
 
13
- gemspec :path => "../"
13
+ gemspec path: "../"
@@ -2,14 +2,14 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3", :platforms => :ruby
6
- gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
5
+ gem "sqlite3", platforms: :ruby
7
6
  gem "rails", "4.0.13"
8
- gem "mime-types", "~> 2", :platforms => [:ruby_19, :jruby]
9
- gem "mongoid", "~>4.0"
7
+ gem "mime-types", "~> 2", platforms: [:ruby_19, :jruby]
8
+ gem "mongoid", "~> 4.0"
10
9
  gem "sequel"
11
- gem "dynamoid", "~> 1", :platforms => :ruby
12
- gem "aws-sdk", "~>2", :platforms => :ruby
10
+ gem "dynamoid", "~> 1", platforms: :ruby
11
+ gem "aws-sdk", "~> 2", platforms: :ruby
13
12
  gem "redis-objects"
13
+ gem "activerecord-jdbcsqlite3-adapter", "1.3.24", platforms: :jruby
14
14
 
15
- gemspec :path => "../"
15
+ gemspec path: "../"