aasm 4.12.3 → 5.0.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +14 -12
- data/Appraisals +39 -16
- data/CHANGELOG.md +8 -1
- data/Dockerfile +44 -0
- data/Gemfile +1 -2
- data/README.md +51 -11
- data/docker-compose.yml +40 -0
- data/gemfiles/rails_3.2.gemfile +6 -6
- data/gemfiles/rails_4.0.gemfile +7 -7
- data/gemfiles/rails_4.2.gemfile +8 -8
- data/gemfiles/rails_4.2_mongoid_5.gemfile +5 -5
- data/gemfiles/rails_4.2_nobrainer.gemfile +9 -0
- data/gemfiles/rails_5.0.gemfile +5 -6
- data/gemfiles/rails_5.0_nobrainer.gemfile +9 -0
- data/gemfiles/rails_5.1.gemfile +13 -0
- data/lib/aasm.rb +5 -0
- data/lib/aasm/aasm.rb +1 -0
- data/lib/aasm/core/event.rb +5 -21
- data/lib/aasm/core/invoker.rb +129 -0
- data/lib/aasm/core/invokers/base_invoker.rb +75 -0
- data/lib/aasm/core/invokers/class_invoker.rb +52 -0
- data/lib/aasm/core/invokers/literal_invoker.rb +47 -0
- data/lib/aasm/core/invokers/proc_invoker.rb +59 -0
- data/lib/aasm/core/state.rb +10 -9
- data/lib/aasm/core/transition.rb +7 -68
- data/lib/aasm/errors.rb +2 -2
- data/lib/aasm/persistence.rb +3 -0
- data/lib/aasm/persistence/no_brainer_persistence.rb +105 -0
- data/lib/aasm/persistence/plain_persistence.rb +2 -1
- data/lib/aasm/persistence/sequel_persistence.rb +0 -1
- data/lib/aasm/rspec/allow_event.rb +5 -1
- data/lib/aasm/rspec/allow_transition_to.rb +5 -1
- data/lib/aasm/version.rb +1 -1
- data/lib/generators/nobrainer/aasm_generator.rb +28 -0
- data/lib/motion-aasm.rb +1 -0
- data/spec/generators/no_brainer_generator_spec.rb +29 -0
- data/spec/models/nobrainer/complex_no_brainer_example.rb +36 -0
- data/spec/models/nobrainer/invalid_persistor_no_brainer.rb +39 -0
- data/spec/models/nobrainer/no_scope_no_brainer.rb +21 -0
- data/spec/models/nobrainer/nobrainer_relationships.rb +25 -0
- data/spec/models/nobrainer/silent_persistor_no_brainer.rb +39 -0
- data/spec/models/nobrainer/simple_new_dsl_nobrainer.rb +25 -0
- data/spec/models/nobrainer/simple_no_brainer.rb +23 -0
- data/spec/models/nobrainer/validator_no_brainer.rb +98 -0
- data/spec/models/simple_example.rb +2 -0
- data/spec/models/simple_example_with_guard_args.rb +17 -0
- data/spec/spec_helpers/active_record.rb +2 -1
- data/spec/spec_helpers/dynamoid.rb +7 -5
- data/spec/spec_helpers/mongoid.rb +20 -1
- data/spec/spec_helpers/nobrainer.rb +15 -0
- data/spec/spec_helpers/redis.rb +5 -2
- data/spec/spec_helpers/sequel.rb +1 -1
- data/spec/unit/callbacks_spec.rb +2 -2
- data/spec/unit/exception_spec.rb +1 -1
- data/spec/unit/invoker_spec.rb +189 -0
- data/spec/unit/invokers/base_invoker_spec.rb +72 -0
- data/spec/unit/invokers/class_invoker_spec.rb +95 -0
- data/spec/unit/invokers/literal_invoker_spec.rb +86 -0
- data/spec/unit/invokers/proc_invoker_spec.rb +86 -0
- data/spec/unit/persistence/mongoid_persistence_multiple_spec.rb +0 -4
- data/spec/unit/persistence/mongoid_persistence_spec.rb +0 -4
- data/spec/unit/persistence/no_brainer_persistence_multiple_spec.rb +198 -0
- data/spec/unit/persistence/no_brainer_persistence_spec.rb +158 -0
- data/spec/unit/rspec_matcher_spec.rb +6 -0
- data/spec/unit/state_spec.rb +2 -2
- data/spec/unit/transition_spec.rb +1 -1
- data/test/minitest_helper.rb +2 -2
- data/test/unit/minitest_matcher_test.rb +1 -1
- metadata +51 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69f97deda18ab481d469c17a67f79bff67fe73ab
|
4
|
+
data.tar.gz: c0f8afb149306a0023e14b511b51f5c4dd681535
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c806b50bca06602c0f9fc72c7f8852315a68d2cfe1cd84e7010c30c21b67668359e6b00e3559e55366048582262b81902a86cbd35ec87afa8976a10293f0837
|
7
|
+
data.tar.gz: e2ef393b52f021463e8734a48e86fe59305d4e2b94e57e82cd4849e216599d17a68134c00331f096a621843a0d35aeff8183dd8232c9d89f4520f5f96b3086cc
|
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-
|
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.
|
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',
|
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',
|
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',
|
15
|
-
gem 'aws-sdk', '~>2',
|
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',
|
21
|
-
gem 'mime-types', '~> 2',
|
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',
|
26
|
-
gem 'aws-sdk', '~>2',
|
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',
|
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',
|
41
|
-
gem 'aws-sdk', '~>2',
|
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,13 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
-
##
|
3
|
+
## 5.0.0
|
4
|
+
|
5
|
+
* Chore(invokers): Refactor callback invokers, add class-callbacks support [#541](https://github.com/aasm/aasm/pull/541), thanks to [pandomic](https://github.com/pandomic)
|
6
|
+
* Add docker setup to readme
|
7
|
+
* Add support for Nobrainer (RethinkDB) [#522](https://github.com/aasm/aasm/pull/522), thanks to [zedtux] (https://github.com/zedtux)
|
8
|
+
* Patch `allow_event` to accept event with custom arguments [#419](https://github.com/aasm/aasm/pull/419), thanks to [czhc](https://github.com/czhc)
|
9
|
+
|
10
|
+
|
4
11
|
## 4.12.3
|
5
12
|
|
6
13
|
* Add to AASM fire(event) and fire!(event) methods [#494](https://github.com/aasm/aasm/pull/494), thanks to [slayer](https://github.com/slayer)
|
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
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
|
-
|
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,16 +130,26 @@ 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
|
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
|
+
class LogRunTime
|
138
|
+
def initialize(resource)
|
139
|
+
@resource = resource
|
140
|
+
end
|
141
|
+
|
142
|
+
def call
|
143
|
+
# Do whatever you want with @resource
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
137
147
|
class Job
|
138
148
|
include AASM
|
139
149
|
|
140
150
|
aasm do
|
141
151
|
state :sleeping, :initial => true, :before_enter => :do_something
|
142
|
-
state :running
|
152
|
+
state :running, before_enter: Proc.new { do_something && notify_somebody }
|
143
153
|
state :finished
|
144
154
|
|
145
155
|
after_all_transitions :log_status_change
|
@@ -195,6 +205,8 @@ is finished.
|
|
195
205
|
|
196
206
|
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
207
|
|
208
|
+
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.
|
209
|
+
|
198
210
|
```ruby
|
199
211
|
class LogRunTime
|
200
212
|
# optional args parameter can be omitted, but if you define initialize
|
@@ -225,7 +237,7 @@ callback, which can handle it or re-raise it for further propagation.
|
|
225
237
|
|
226
238
|
Also, you can define a method that will be called if any event fails:
|
227
239
|
|
228
|
-
```
|
240
|
+
```ruby
|
229
241
|
def aasm_event_failed(event_name, old_state_name)
|
230
242
|
# use custom exception/messages, report metrics, etc
|
231
243
|
end
|
@@ -523,7 +535,7 @@ All _AASM_ class- and instance-level `aasm` methods accept a state machine selec
|
|
523
535
|
So, for example, to use inspection on a class level, you have to use
|
524
536
|
|
525
537
|
```ruby
|
526
|
-
SimpleMultipleExample.aasm(:
|
538
|
+
SimpleMultipleExample.aasm(:move).states.map(&:name)
|
527
539
|
# => [:standing, :walking, :running]
|
528
540
|
```
|
529
541
|
|
@@ -630,7 +642,7 @@ class CustomAASMBase < AASM::Base
|
|
630
642
|
end
|
631
643
|
```
|
632
644
|
|
633
|
-
When we declare our model that has an AASM state machine, we simply declare the AASM block with a `:
|
645
|
+
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
646
|
|
635
647
|
```ruby
|
636
648
|
class SimpleCustomExample
|
@@ -825,6 +837,23 @@ class Job
|
|
825
837
|
end
|
826
838
|
```
|
827
839
|
|
840
|
+
### NoBrainer
|
841
|
+
|
842
|
+
AASM also supports persistence to [RethinkDB](https://www.rethinkdb.com/)
|
843
|
+
if you're using [Nobrainer](http://nobrainer.io/).
|
844
|
+
Make sure to include NoBrainer::Document before you include AASM.
|
845
|
+
|
846
|
+
```ruby
|
847
|
+
class Job
|
848
|
+
include NoBrainer::Document
|
849
|
+
include AASM
|
850
|
+
field :aasm_state
|
851
|
+
aasm do
|
852
|
+
...
|
853
|
+
end
|
854
|
+
end
|
855
|
+
```
|
856
|
+
|
828
857
|
### Redis
|
829
858
|
|
830
859
|
AASM also supports persistence in Redis via
|
@@ -1193,6 +1222,9 @@ expect(multiple).to allow_event(:start).on(:move)
|
|
1193
1222
|
expect(multiple).to_not allow_event(:stop).on(:move)
|
1194
1223
|
expect(multiple).to allow_transition_to(:processing).on(:move)
|
1195
1224
|
expect(multiple).to_not allow_transition_to(:sleeping).on(:move)
|
1225
|
+
# allow_event also accepts arguments
|
1226
|
+
expect(job).to allow_event(:run).with(:defragmentation)
|
1227
|
+
|
1196
1228
|
```
|
1197
1229
|
|
1198
1230
|
#### Minitest
|
@@ -1203,7 +1235,7 @@ AASM provides assertions and rspec-like expectations for [Minitest](https://gith
|
|
1203
1235
|
|
1204
1236
|
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
1237
|
|
1206
|
-
Add `require 'aasm/minitest' to your `test_helper.rb` file and use them like this:
|
1238
|
+
Add `require 'aasm/minitest'` to your `test_helper.rb` file and use them like this:
|
1207
1239
|
|
1208
1240
|
```ruby
|
1209
1241
|
# classes with only the default state machine
|
@@ -1312,6 +1344,14 @@ Replace NAME with the Model name, COLUMN_NAME is optional(default is 'aasm_state
|
|
1312
1344
|
This will create a model (if one does not exist) and configure it with aasm block.
|
1313
1345
|
For Active record orm a migration file is added to add aasm state column to table.
|
1314
1346
|
|
1347
|
+
### Docker
|
1348
|
+
|
1349
|
+
Run test suite easily on docker
|
1350
|
+
```
|
1351
|
+
1. docker-compose build aasm
|
1352
|
+
2. docker-compose run --rm aasm
|
1353
|
+
```
|
1354
|
+
|
1315
1355
|
## Latest changes ##
|
1316
1356
|
|
1317
1357
|
Take a look at the [CHANGELOG](https://github.com/aasm/aasm/blob/master/CHANGELOG.md) for details about recent changes to the current version.
|
data/docker-compose.yml
ADDED
@@ -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
|
data/gemfiles/rails_3.2.gemfile
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "sqlite3", :
|
6
|
-
gem "
|
7
|
-
gem "
|
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", :
|
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 :
|
13
|
+
gemspec path: "../"
|
data/gemfiles/rails_4.0.gemfile
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "sqlite3", :
|
6
|
-
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
5
|
+
gem "sqlite3", platforms: :ruby
|
7
6
|
gem "rails", "4.0.13"
|
8
|
-
gem "mime-types", "~> 2", :
|
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", :
|
12
|
-
gem "aws-sdk", "~>2", :
|
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 :
|
15
|
+
gemspec path: "../"
|