Skip to content

Commit 177b65c

Browse files
committed
chore(): support both mongoid 4 & 5
1 parent f4c3565 commit 177b65c

File tree

12 files changed

+439
-9
lines changed

12 files changed

+439
-9
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ruby-2.1.5
1+
ruby-2.3.0

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
source 'https://rubygems.org'
22

3-
gem 'bundler', '>= 1.7'
3+
gem 'mongoid', '~> 5.1.2'
44
gem 'rake', '~> 10.4.2'
55
gem 'rspec', '~> 3.1.0'
66
gem 'guard-rspec', '~> 4.6.4'
77
gem 'pry', '~> 0.9.12.6'
88
gem 'simplecov', '~> 0.10.0'
99
gem 'coveralls', '~> 0.8.2', require: false
1010
gem 'codeclimate-test-reporter'
11-
gem 'ammeter', '~> 1.1.2'
1211
gem 'railties'
1312

1413
# Specify your gem's dependencies in mongoid-observers.gemspec

Rakefile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,22 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
77
spec.pattern = FileList["spec/**/*_spec.rb"]
88
end
99

10-
task :default => "spec"
10+
task :default => "spec:all"
11+
12+
namespace :spec do
13+
%w(mongoid_4 mongoid_5).each do |gemfile|
14+
desc "Run Tests against #{gemfile}"
15+
task gemfile do
16+
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle --quiet"
17+
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle exec rake spec"
18+
end
19+
end
20+
21+
desc "Run Tests against rails versions"
22+
task :all do
23+
%w(mongoid_4 mongoid_5).each do |gemfile|
24+
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle --quiet"
25+
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle exec rake spec"
26+
end
27+
end
28+
end

gemfiles/mongoid_4.gemfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'mongoid', '~> 4.0.2'
4+
gem 'rake', '~> 10.4.2'
5+
gem 'rspec', '~> 3.1.0'
6+
gem 'guard-rspec', '~> 4.6.4'
7+
gem 'pry', '~> 0.9.12.6'
8+
gem 'simplecov', '~> 0.10.0'
9+
gem 'coveralls', '~> 0.8.2', require: false
10+
gem 'codeclimate-test-reporter'
11+
gem 'railties'
12+
13+
gemspec :path => '../'

gemfiles/mongoid_4.gemfile.lock

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
PATH
2+
remote: ../
3+
specs:
4+
mongoid-observers (0.1.1)
5+
mongoid (>= 4.0.0)
6+
rails-observers (~> 0.1.2)
7+
8+
GEM
9+
remote: https://rubygems.org/
10+
specs:
11+
actionpack (4.2.6)
12+
actionview (= 4.2.6)
13+
activesupport (= 4.2.6)
14+
rack (~> 1.6)
15+
rack-test (~> 0.6.2)
16+
rails-dom-testing (~> 1.0, >= 1.0.5)
17+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
18+
actionview (4.2.6)
19+
activesupport (= 4.2.6)
20+
builder (~> 3.1)
21+
erubis (~> 2.7.0)
22+
rails-dom-testing (~> 1.0, >= 1.0.5)
23+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
24+
activemodel (4.2.6)
25+
activesupport (= 4.2.6)
26+
builder (~> 3.1)
27+
activesupport (4.2.6)
28+
i18n (~> 0.7)
29+
json (~> 1.7, >= 1.7.7)
30+
minitest (~> 5.1)
31+
thread_safe (~> 0.3, >= 0.3.4)
32+
tzinfo (~> 1.1)
33+
ammeter (1.1.3)
34+
activesupport (>= 3.0)
35+
railties (>= 3.0)
36+
rspec-rails (>= 2.2)
37+
bson (3.2.6)
38+
builder (3.2.2)
39+
codeclimate-test-reporter (0.5.0)
40+
simplecov (>= 0.7.1, < 1.0.0)
41+
coderay (1.1.1)
42+
connection_pool (2.2.0)
43+
coveralls (0.8.9)
44+
json (~> 1.8)
45+
rest-client (>= 1.6.8, < 2)
46+
simplecov (~> 0.10.0)
47+
term-ansicolor (~> 1.3)
48+
thor (~> 0.19.1)
49+
tins (~> 1.6.0)
50+
diff-lcs (1.2.5)
51+
docile (1.1.5)
52+
domain_name (0.5.20160310)
53+
unf (>= 0.0.5, < 1.0.0)
54+
erubis (2.7.0)
55+
ffi (1.9.10)
56+
formatador (0.2.5)
57+
guard (2.13.0)
58+
formatador (>= 0.2.4)
59+
listen (>= 2.7, <= 4.0)
60+
lumberjack (~> 1.0)
61+
nenv (~> 0.1)
62+
notiffany (~> 0.0)
63+
pry (>= 0.9.12)
64+
shellany (~> 0.0)
65+
thor (>= 0.18.1)
66+
guard-compat (1.2.1)
67+
guard-rspec (4.6.5)
68+
guard (~> 2.1)
69+
guard-compat (~> 1.1)
70+
rspec (>= 2.99.0, < 4.0)
71+
http-cookie (1.0.2)
72+
domain_name (~> 0.5)
73+
i18n (0.7.0)
74+
json (1.8.3)
75+
listen (3.0.6)
76+
rb-fsevent (>= 0.9.3)
77+
rb-inotify (>= 0.9.7)
78+
loofah (2.0.3)
79+
nokogiri (>= 1.5.9)
80+
lumberjack (1.0.10)
81+
method_source (0.8.2)
82+
mime-types (2.99.1)
83+
mini_portile2 (2.0.0)
84+
minitest (5.8.4)
85+
mongoid (4.0.2)
86+
activemodel (~> 4.0)
87+
moped (~> 2.0.0)
88+
origin (~> 2.1)
89+
tzinfo (>= 0.3.37)
90+
moped (2.0.7)
91+
bson (~> 3.0)
92+
connection_pool (~> 2.0)
93+
optionable (~> 0.2.0)
94+
nenv (0.3.0)
95+
netrc (0.11.0)
96+
nokogiri (1.6.7.2)
97+
mini_portile2 (~> 2.0.0.rc2)
98+
notiffany (0.0.8)
99+
nenv (~> 0.1)
100+
shellany (~> 0.0)
101+
optionable (0.2.0)
102+
origin (2.2.0)
103+
pry (0.9.12.6)
104+
coderay (~> 1.0)
105+
method_source (~> 0.8)
106+
slop (~> 3.4)
107+
rack (1.6.4)
108+
rack-test (0.6.3)
109+
rack (>= 1.0)
110+
rails-deprecated_sanitizer (1.0.3)
111+
activesupport (>= 4.2.0.alpha)
112+
rails-dom-testing (1.0.7)
113+
activesupport (>= 4.2.0.beta, < 5.0)
114+
nokogiri (~> 1.6.0)
115+
rails-deprecated_sanitizer (>= 1.0.1)
116+
rails-html-sanitizer (1.0.3)
117+
loofah (~> 2.0)
118+
rails-observers (0.1.2)
119+
activemodel (~> 4.0)
120+
railties (4.2.6)
121+
actionpack (= 4.2.6)
122+
activesupport (= 4.2.6)
123+
rake (>= 0.8.7)
124+
thor (>= 0.18.1, < 2.0)
125+
rake (10.4.2)
126+
rb-fsevent (0.9.7)
127+
rb-inotify (0.9.7)
128+
ffi (>= 0.5.0)
129+
rest-client (1.8.0)
130+
http-cookie (>= 1.0.2, < 2.0)
131+
mime-types (>= 1.16, < 3.0)
132+
netrc (~> 0.7)
133+
rspec (3.1.0)
134+
rspec-core (~> 3.1.0)
135+
rspec-expectations (~> 3.1.0)
136+
rspec-mocks (~> 3.1.0)
137+
rspec-core (3.1.7)
138+
rspec-support (~> 3.1.0)
139+
rspec-expectations (3.1.2)
140+
diff-lcs (>= 1.2.0, < 2.0)
141+
rspec-support (~> 3.1.0)
142+
rspec-mocks (3.1.3)
143+
rspec-support (~> 3.1.0)
144+
rspec-rails (3.1.0)
145+
actionpack (>= 3.0)
146+
activesupport (>= 3.0)
147+
railties (>= 3.0)
148+
rspec-core (~> 3.1.0)
149+
rspec-expectations (~> 3.1.0)
150+
rspec-mocks (~> 3.1.0)
151+
rspec-support (~> 3.1.0)
152+
rspec-support (3.1.2)
153+
shellany (0.0.1)
154+
simplecov (0.10.0)
155+
docile (~> 1.1.0)
156+
json (~> 1.8)
157+
simplecov-html (~> 0.10.0)
158+
simplecov-html (0.10.0)
159+
slop (3.6.0)
160+
term-ansicolor (1.3.2)
161+
tins (~> 1.0)
162+
thor (0.19.1)
163+
thread_safe (0.3.5)
164+
tins (1.6.0)
165+
tzinfo (1.2.2)
166+
thread_safe (~> 0.1)
167+
unf (0.1.4)
168+
unf_ext
169+
unf_ext (0.0.7.2)
170+
171+
PLATFORMS
172+
ruby
173+
174+
DEPENDENCIES
175+
ammeter (~> 1.1.2)
176+
bundler (~> 1.11)
177+
codeclimate-test-reporter
178+
coveralls (~> 0.8.2)
179+
guard-rspec (~> 4.6.4)
180+
mongoid (~> 4.0.2)
181+
mongoid-observers!
182+
pry (~> 0.9.12.6)
183+
railties
184+
rake (~> 10.4.2)
185+
rspec (~> 3.1.0)
186+
simplecov (~> 0.10.0)
187+
188+
BUNDLED WITH
189+
1.11.2

gemfiles/mongoid_5.gemfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'mongoid', '~> 5.1.2'
4+
gem 'rake', '~> 10.4.2'
5+
gem 'rspec', '~> 3.1.0'
6+
gem 'guard-rspec', '~> 4.6.4'
7+
gem 'pry', '~> 0.9.12.6'
8+
gem 'simplecov', '~> 0.10.0'
9+
gem 'coveralls', '~> 0.8.2', require: false
10+
gem 'codeclimate-test-reporter'
11+
gem 'railties'
12+
13+
gemspec :path => '../'

0 commit comments

Comments
 (0)