Skip to content

Commit 2833ceb

Browse files
committed
Support Mongoid 6 and Rails 5
1 parent db618b7 commit 2833ceb

14 files changed

+209
-266
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
services: mongodb
22
language: ruby
3-
before_install: gem install bundler -v='1.11.2'
4-
script: "bundle exec rake spec:all"
3+
script: "bundle exec rake spec:mongoid_6"
54
rvm:
6-
- 2.3.1
5+
- 2.3.0
76
env:
87
- CODECLIMATE_REPO_TOKEN=f506e465f1ed0571aeaa5e1cb9c14214c9f7567a92d1af70903f3d0bc8015ed6
98
notifications:

Gemfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
source 'https://rubygems.org'
22

3-
gem 'mongoid', '~> 5.1.2'
3+
gem 'mongoid', '~> 6.0.2'
44
gem 'rails-observers', github: 'rails/rails-observers'
55
gem 'rake', '~> 10.4.2'
6-
gem 'rspec', '~> 3.1.0'
7-
gem 'guard-rspec', '~> 4.6.4'
6+
gem 'rspec', '~> 3.5.0'
7+
gem 'rspec-rails', '~> 3.5.2'
8+
gem 'guard-rspec', '~> 4.7.3'
89
gem 'pry', '~> 0.9.12.6'
9-
gem 'simplecov', '~> 0.10.0'
10-
gem 'coveralls', '~> 0.8.2', require: false
11-
gem 'codeclimate-test-reporter'
12-
gem 'railties'
10+
gem 'simplecov', '~> 0.12.0'
11+
gem 'coveralls', '~> 0.8.15', require: false
12+
gem 'railties', '~> 5.0.0.1'
13+
gem 'ammeter', '~> 1.1.4'
14+
gem 'bundler'
1315

1416
# Specify your gem's dependencies in mongoid-observers.gemspec
15-
gemspec
17+
gemspec

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@ Mongoid Observers (removed from core in Mongoid 4.0). Because this gem doesn't e
44

55
## Installation
66

7-
Add this line to your application's Gemfile:
7+
For Rails 5+, Add this line to your application's Gemfile:
88

9-
gem 'mongoid-observers'
9+
gem 'mongoid-observers', '~> 0.3.0'
10+
gem 'rails-observers', github: 'rails/rails-observers'
1011

11-
And then execute:
12+
**NOTE:** `mongoid-observers` depends on `rails-observers` mostly, but it is not yet ready for a new release on Rails 5 yet, https://github.com/rails/rails-observers/issues/53.
1213

13-
$ bundle
14+
For Rails 4 and below, Add this line to your application's Gemfile:
1415

15-
Or install it yourself as:
16+
gem 'mongoid-observers', '~> 0.2.0'
1617

17-
$ gem install mongoid-observers
18+
And then execute:
19+
20+
$ bundle
1821

1922
## Usage
2023

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ namespace :spec do
1313
%w(mongoid_4 mongoid_5 mongoid_6).each do |gemfile|
1414
desc "Run Tests against #{gemfile}"
1515
task gemfile do
16-
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle --quiet"
16+
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle install --quiet"
1717
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle exec rake spec"
1818
end
1919
end
2020

2121
desc "Run Tests against rails versions"
2222
task :all do
2323
%w(mongoid_4 mongoid_5 mongoid_6).each do |gemfile|
24-
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle --quiet"
24+
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle install --quiet"
2525
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle exec rake spec"
2626
end
2727
end

gemfiles/mongoid_4.gemfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ gem 'rake', '~> 10.4.2'
66
gem 'rspec', '~> 3.1.0'
77
gem 'guard-rspec', '~> 4.6.4'
88
gem 'pry', '~> 0.9.12.6'
9-
gem 'simplecov', '~> 0.10.0'
10-
gem 'coveralls', '~> 0.8.2', require: false
11-
gem 'codeclimate-test-reporter'
12-
gem 'railties'
9+
gem 'simplecov', '~> 0.12.0'
10+
gem 'coveralls', '~> 0.8.15', require: false
11+
gem 'railties', '~> 4.2.6'
12+
gem 'ammeter', '~> 1.1.4'
13+
gem 'bundler'
1314

14-
gemspec :path => '../'
15+
gemspec :path => '../'

gemfiles/mongoid_4.gemfile.lock

Lines changed: 42 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,56 @@
11
PATH
22
remote: ../
33
specs:
4-
mongoid-observers (0.2.0)
4+
mongoid-observers (0.3.0)
55
mongoid (>= 4.0.0)
66

77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
actionpack (4.2.6)
11-
actionview (= 4.2.6)
12-
activesupport (= 4.2.6)
10+
actionpack (4.2.7.1)
11+
actionview (= 4.2.7.1)
12+
activesupport (= 4.2.7.1)
1313
rack (~> 1.6)
1414
rack-test (~> 0.6.2)
1515
rails-dom-testing (~> 1.0, >= 1.0.5)
1616
rails-html-sanitizer (~> 1.0, >= 1.0.2)
17-
actionview (4.2.6)
18-
activesupport (= 4.2.6)
17+
actionview (4.2.7.1)
18+
activesupport (= 4.2.7.1)
1919
builder (~> 3.1)
2020
erubis (~> 2.7.0)
2121
rails-dom-testing (~> 1.0, >= 1.0.5)
2222
rails-html-sanitizer (~> 1.0, >= 1.0.2)
23-
activemodel (4.2.6)
24-
activesupport (= 4.2.6)
23+
activemodel (4.2.7.1)
24+
activesupport (= 4.2.7.1)
2525
builder (~> 3.1)
26-
activesupport (4.2.6)
26+
activesupport (4.2.7.1)
2727
i18n (~> 0.7)
2828
json (~> 1.7, >= 1.7.7)
2929
minitest (~> 5.1)
3030
thread_safe (~> 0.3, >= 0.3.4)
3131
tzinfo (~> 1.1)
32-
ammeter (1.1.3)
32+
ammeter (1.1.4)
3333
activesupport (>= 3.0)
3434
railties (>= 3.0)
3535
rspec-rails (>= 2.2)
3636
bson (3.2.6)
3737
builder (3.2.2)
38-
codeclimate-test-reporter (0.5.0)
39-
simplecov (>= 0.7.1, < 1.0.0)
4038
coderay (1.1.1)
4139
connection_pool (2.2.0)
42-
coveralls (0.8.9)
43-
json (~> 1.8)
44-
rest-client (>= 1.6.8, < 2)
45-
simplecov (~> 0.10.0)
40+
coveralls (0.8.15)
41+
json (>= 1.8, < 3)
42+
simplecov (~> 0.12.0)
4643
term-ansicolor (~> 1.3)
4744
thor (~> 0.19.1)
48-
tins (~> 1.6.0)
45+
tins (>= 1.6.0, < 2)
4946
diff-lcs (1.2.5)
5047
docile (1.1.5)
51-
domain_name (0.5.20160310)
52-
unf (>= 0.0.5, < 1.0.0)
5348
erubis (2.7.0)
54-
ffi (1.9.10)
49+
ffi (1.9.14)
5550
formatador (0.2.5)
56-
guard (2.13.0)
51+
guard (2.14.0)
5752
formatador (>= 0.2.4)
58-
listen (>= 2.7, <= 4.0)
53+
listen (>= 2.7, < 4.0)
5954
lumberjack (~> 1.0)
6055
nenv (~> 0.1)
6156
notiffany (~> 0.0)
@@ -67,20 +62,18 @@ GEM
6762
guard (~> 2.1)
6863
guard-compat (~> 1.1)
6964
rspec (>= 2.99.0, < 4.0)
70-
http-cookie (1.0.2)
71-
domain_name (~> 0.5)
7265
i18n (0.7.0)
7366
json (1.8.3)
74-
listen (3.0.6)
75-
rb-fsevent (>= 0.9.3)
76-
rb-inotify (>= 0.9.7)
67+
listen (3.1.5)
68+
rb-fsevent (~> 0.9, >= 0.9.4)
69+
rb-inotify (~> 0.9, >= 0.9.7)
70+
ruby_dep (~> 1.2)
7771
loofah (2.0.3)
7872
nokogiri (>= 1.5.9)
7973
lumberjack (1.0.10)
8074
method_source (0.8.2)
81-
mime-types (2.99.1)
82-
mini_portile2 (2.0.0)
83-
minitest (5.8.4)
75+
mini_portile2 (2.1.0)
76+
minitest (5.9.1)
8477
mongoid (4.0.2)
8578
activemodel (~> 4.0)
8679
moped (~> 2.0.0)
@@ -91,14 +84,13 @@ GEM
9184
connection_pool (~> 2.0)
9285
optionable (~> 0.2.0)
9386
nenv (0.3.0)
94-
netrc (0.11.0)
95-
nokogiri (1.6.7.2)
96-
mini_portile2 (~> 2.0.0.rc2)
97-
notiffany (0.0.8)
87+
nokogiri (1.6.8.1)
88+
mini_portile2 (~> 2.1.0)
89+
notiffany (0.1.1)
9890
nenv (~> 0.1)
9991
shellany (~> 0.0)
10092
optionable (0.2.0)
101-
origin (2.2.0)
93+
origin (2.2.2)
10294
pry (0.9.12.6)
10395
coderay (~> 1.0)
10496
method_source (~> 0.8)
@@ -116,19 +108,15 @@ GEM
116108
loofah (~> 2.0)
117109
rails-observers (0.1.2)
118110
activemodel (~> 4.0)
119-
railties (4.2.6)
120-
actionpack (= 4.2.6)
121-
activesupport (= 4.2.6)
111+
railties (4.2.7.1)
112+
actionpack (= 4.2.7.1)
113+
activesupport (= 4.2.7.1)
122114
rake (>= 0.8.7)
123115
thor (>= 0.18.1, < 2.0)
124116
rake (10.4.2)
125-
rb-fsevent (0.9.7)
117+
rb-fsevent (0.9.8)
126118
rb-inotify (0.9.7)
127119
ffi (>= 0.5.0)
128-
rest-client (1.8.0)
129-
http-cookie (>= 1.0.2, < 2.0)
130-
mime-types (>= 1.16, < 3.0)
131-
netrc (~> 0.7)
132120
rspec (3.1.0)
133121
rspec-core (~> 3.1.0)
134122
rspec-expectations (~> 3.1.0)
@@ -149,41 +137,38 @@ GEM
149137
rspec-mocks (~> 3.1.0)
150138
rspec-support (~> 3.1.0)
151139
rspec-support (3.1.2)
140+
ruby_dep (1.5.0)
152141
shellany (0.0.1)
153-
simplecov (0.10.0)
142+
simplecov (0.12.0)
154143
docile (~> 1.1.0)
155-
json (~> 1.8)
144+
json (>= 1.8, < 3)
156145
simplecov-html (~> 0.10.0)
157146
simplecov-html (0.10.0)
158147
slop (3.6.0)
159-
term-ansicolor (1.3.2)
148+
term-ansicolor (1.4.0)
160149
tins (~> 1.0)
161150
thor (0.19.1)
162151
thread_safe (0.3.5)
163-
tins (1.6.0)
152+
tins (1.12.0)
164153
tzinfo (1.2.2)
165154
thread_safe (~> 0.1)
166-
unf (0.1.4)
167-
unf_ext
168-
unf_ext (0.0.7.2)
169155

170156
PLATFORMS
171157
ruby
172158

173159
DEPENDENCIES
174-
ammeter (~> 1.1.2)
175-
bundler (~> 1.11)
176-
codeclimate-test-reporter
177-
coveralls (~> 0.8.2)
160+
ammeter (~> 1.1.4)
161+
bundler
162+
coveralls (~> 0.8.15)
178163
guard-rspec (~> 4.6.4)
179164
mongoid (~> 4.0.2)
180165
mongoid-observers!
181166
pry (~> 0.9.12.6)
182167
rails-observers (~> 0.1.2)
183-
railties
168+
railties (~> 4.2.6)
184169
rake (~> 10.4.2)
185170
rspec (~> 3.1.0)
186-
simplecov (~> 0.10.0)
171+
simplecov (~> 0.12.0)
187172

188173
BUNDLED WITH
189-
1.12.1
174+
1.13.6

gemfiles/mongoid_5.gemfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ gem 'rake', '~> 10.4.2'
66
gem 'rspec', '~> 3.1.0'
77
gem 'guard-rspec', '~> 4.6.4'
88
gem 'pry', '~> 0.9.12.6'
9-
gem 'simplecov', '~> 0.10.0'
10-
gem 'coveralls', '~> 0.8.2', require: false
11-
gem 'codeclimate-test-reporter'
12-
gem 'railties'
9+
gem 'simplecov', '~> 0.12.0'
10+
gem 'coveralls', '~> 0.8.15', require: false
11+
gem 'railties', '~> 4.2.6'
12+
gem 'ammeter', '~> 1.1.4'
13+
gem 'bundler'
1314

14-
gemspec :path => '../'
15+
gemspec :path => '../'

0 commit comments

Comments
 (0)