Skip to content

Commit 1c73400

Browse files
committed
WIP: Working with Ruby 3.1
1 parent 813c2a1 commit 1c73400

17 files changed

Lines changed: 258 additions & 104 deletions

Gemfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ gemspec
55
gem 'ransack-mongoid', path: "~/development/open_source/ransack-mongoid/"#, git: 'https://github.com/skalibog/ransack-mongoid'
66
gem 'ransack', '~> 2.1.0'
77

8-
gem 'rails', '>= 5.2', '< 6.1'
9-
gem 'mongoid', '= 7.0.0'
8+
gem 'rails', '~> 6.0.3'
9+
gem 'mongoid', '= 7.1.0'
10+
gem 'concurrent-ruby', '1.3.4'
11+
gem 'webrick', '~> 1.7'
1012

13+
gem 'mongo', '~> 2.16.4'
1114
gem 'devise'
1215

1316
gem 'pry-rails'

Gemfile.lock

Lines changed: 104 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PATH
77
remote: .
88
specs:
99
activeadmin-mongoid (1.0.0)
10-
activeadmin (>= 1.3.0, <= 2.6.0)
10+
activeadmin (>= 1.3.0, <= 2.8.0)
1111
jquery-rails
1212
kaminari-mongoid
1313
mongoid (>= 6.0, < 8.a)
@@ -16,67 +16,81 @@ PATH
1616
GEM
1717
remote: https://rubygems.org/
1818
specs:
19-
actioncable (5.2.8.1)
20-
actionpack (= 5.2.8.1)
19+
actioncable (6.0.6.1)
20+
actionpack (= 6.0.6.1)
2121
nio4r (~> 2.0)
2222
websocket-driver (>= 0.6.1)
23-
actionmailer (5.2.8.1)
24-
actionpack (= 5.2.8.1)
25-
actionview (= 5.2.8.1)
26-
activejob (= 5.2.8.1)
23+
actionmailbox (6.0.6.1)
24+
actionpack (= 6.0.6.1)
25+
activejob (= 6.0.6.1)
26+
activerecord (= 6.0.6.1)
27+
activestorage (= 6.0.6.1)
28+
activesupport (= 6.0.6.1)
29+
mail (>= 2.7.1)
30+
actionmailer (6.0.6.1)
31+
actionpack (= 6.0.6.1)
32+
actionview (= 6.0.6.1)
33+
activejob (= 6.0.6.1)
2734
mail (~> 2.5, >= 2.5.4)
2835
rails-dom-testing (~> 2.0)
29-
actionpack (5.2.8.1)
30-
actionview (= 5.2.8.1)
31-
activesupport (= 5.2.8.1)
36+
actionpack (6.0.6.1)
37+
actionview (= 6.0.6.1)
38+
activesupport (= 6.0.6.1)
3239
rack (~> 2.0, >= 2.0.8)
3340
rack-test (>= 0.6.3)
3441
rails-dom-testing (~> 2.0)
35-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
36-
actionview (5.2.8.1)
37-
activesupport (= 5.2.8.1)
42+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
43+
actiontext (6.0.6.1)
44+
actionpack (= 6.0.6.1)
45+
activerecord (= 6.0.6.1)
46+
activestorage (= 6.0.6.1)
47+
activesupport (= 6.0.6.1)
48+
nokogiri (>= 1.8.5)
49+
actionview (6.0.6.1)
50+
activesupport (= 6.0.6.1)
3851
builder (~> 3.1)
3952
erubi (~> 1.4)
4053
rails-dom-testing (~> 2.0)
41-
rails-html-sanitizer (~> 1.0, >= 1.0.3)
42-
activeadmin (2.6.0)
54+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
55+
activeadmin (2.8.0)
4356
arbre (~> 1.2, >= 1.2.1)
44-
formtastic (~> 3.1)
57+
formtastic (>= 3.1, < 5.0)
4558
formtastic_i18n (~> 0.4)
4659
inherited_resources (~> 1.7)
4760
jquery-rails (~> 4.2)
48-
kaminari (~> 1.0, >= 1.0.1)
61+
kaminari (~> 1.0, >= 1.2.1)
4962
railties (>= 5.2, < 6.1)
5063
ransack (~> 2.1, >= 2.1.1)
5164
sassc-rails (~> 2.1)
5265
sprockets (>= 3.0, < 4.1)
53-
activejob (5.2.8.1)
54-
activesupport (= 5.2.8.1)
66+
activejob (6.0.6.1)
67+
activesupport (= 6.0.6.1)
5568
globalid (>= 0.3.6)
56-
activemodel (5.2.8.1)
57-
activesupport (= 5.2.8.1)
58-
activerecord (5.2.8.1)
59-
activemodel (= 5.2.8.1)
60-
activesupport (= 5.2.8.1)
61-
arel (>= 9.0)
62-
activestorage (5.2.8.1)
63-
actionpack (= 5.2.8.1)
64-
activerecord (= 5.2.8.1)
65-
marcel (~> 1.0.0)
66-
activesupport (5.2.8.1)
69+
activemodel (6.0.6.1)
70+
activesupport (= 6.0.6.1)
71+
activerecord (6.0.6.1)
72+
activemodel (= 6.0.6.1)
73+
activesupport (= 6.0.6.1)
74+
activestorage (6.0.6.1)
75+
actionpack (= 6.0.6.1)
76+
activejob (= 6.0.6.1)
77+
activerecord (= 6.0.6.1)
78+
marcel (~> 1.0)
79+
activesupport (6.0.6.1)
6780
concurrent-ruby (~> 1.0, >= 1.0.2)
6881
i18n (>= 0.7, < 2)
6982
minitest (~> 5.1)
7083
tzinfo (~> 1.1)
84+
zeitwerk (~> 2.2, >= 2.2.2)
7185
addressable (2.8.7)
7286
public_suffix (>= 2.0.2, < 7.0)
7387
arbre (1.7.0)
7488
activesupport (>= 3.0.0)
7589
ruby2_keywords (>= 0.0.2)
76-
arel (9.0.0)
7790
ast (2.4.2)
91+
base64 (0.3.0)
7892
bcrypt (3.1.20)
79-
bson (5.0.1)
93+
bson (4.15.0)
8094
builder (3.3.0)
8195
capybara (3.39.2)
8296
addressable
@@ -93,7 +107,7 @@ GEM
93107
coderay (1.1.3)
94108
concurrent-ruby (1.3.4)
95109
crass (1.0.6)
96-
date (3.3.4)
110+
date (3.4.1)
97111
devise (4.9.4)
98112
bcrypt (~> 3.0)
99113
orm_adapter (~> 0.1)
@@ -102,23 +116,23 @@ GEM
102116
warden (~> 1.2.3)
103117
diff-lcs (1.5.1)
104118
docile (1.4.1)
105-
erubi (1.13.0)
106-
ffi (1.17.0)
107-
formtastic (3.1.5)
108-
actionpack (>= 3.2.13)
119+
erubi (1.13.1)
120+
ffi (1.17.2)
121+
formtastic (4.0.0)
122+
actionpack (>= 5.2.0)
109123
formtastic_i18n (0.7.0)
110124
globalid (1.1.0)
111125
activesupport (>= 5.0)
112126
has_scope (0.8.2)
113127
actionpack (>= 5.2)
114128
activesupport (>= 5.2)
115-
i18n (1.14.5)
129+
i18n (1.14.7)
116130
concurrent-ruby (~> 1.0)
117-
inherited_resources (1.13.1)
118-
actionpack (>= 5.2, < 7.1)
119-
has_scope (~> 0.6)
120-
railties (>= 5.2, < 7.1)
121-
responders (>= 2, < 4)
131+
inherited_resources (1.14.0)
132+
actionpack (>= 6.0)
133+
has_scope (>= 0.6)
134+
railties (>= 6.0)
135+
responders (>= 2)
122136
jaro_winkler (1.5.6)
123137
jquery-rails (4.6.0)
124138
rails-dom-testing (>= 1, < 3)
@@ -148,7 +162,7 @@ GEM
148162
addressable (~> 2.8)
149163
childprocess (~> 5.0)
150164
logger (1.6.0)
151-
loofah (2.22.0)
165+
loofah (2.24.1)
152166
crass (~> 1.0.2)
153167
nokogiri (>= 1.12.0)
154168
mail (2.8.1)
@@ -160,24 +174,24 @@ GEM
160174
matrix (0.4.2)
161175
method_source (1.1.0)
162176
mini_mime (1.1.5)
163-
mini_portile2 (2.8.7)
164-
minitest (5.24.1)
165-
mongo (2.20.1)
166-
bson (>= 4.14.1, < 6.0.0)
167-
mongoid (7.0.0)
168-
activemodel (>= 5.1, < 6.0.0)
169-
mongo (>= 2.5.1, < 3.0.0)
170-
net-imap (0.4.14)
177+
mini_portile2 (2.8.9)
178+
minitest (5.25.5)
179+
mongo (2.16.4)
180+
bson (>= 4.8.2, < 5.0.0)
181+
mongoid (7.1.0)
182+
activemodel (>= 5.1, < 6.1)
183+
mongo (>= 2.7.0, < 3.0.0)
184+
net-imap (0.5.8)
171185
date
172186
net-protocol
173187
net-pop (0.1.2)
174188
net-protocol
175189
net-protocol (0.2.2)
176190
timeout
177-
net-smtp (0.5.0)
191+
net-smtp (0.5.1)
178192
net-protocol
179-
nio4r (2.7.3)
180-
nokogiri (1.15.6)
193+
nio4r (2.7.4)
194+
nokogiri (1.18.8)
181195
mini_portile2 (~> 2.8.2)
182196
racc (~> 1.4)
183197
orm_adapter (0.5.0)
@@ -196,37 +210,39 @@ GEM
196210
pry (>= 0.13.0)
197211
public_suffix (5.1.1)
198212
racc (1.8.1)
199-
rack (2.2.9)
200-
rack-test (2.1.0)
213+
rack (2.2.17)
214+
rack-test (2.2.0)
201215
rack (>= 1.3)
202-
rails (5.2.8.1)
203-
actioncable (= 5.2.8.1)
204-
actionmailer (= 5.2.8.1)
205-
actionpack (= 5.2.8.1)
206-
actionview (= 5.2.8.1)
207-
activejob (= 5.2.8.1)
208-
activemodel (= 5.2.8.1)
209-
activerecord (= 5.2.8.1)
210-
activestorage (= 5.2.8.1)
211-
activesupport (= 5.2.8.1)
216+
rails (6.0.6.1)
217+
actioncable (= 6.0.6.1)
218+
actionmailbox (= 6.0.6.1)
219+
actionmailer (= 6.0.6.1)
220+
actionpack (= 6.0.6.1)
221+
actiontext (= 6.0.6.1)
222+
actionview (= 6.0.6.1)
223+
activejob (= 6.0.6.1)
224+
activemodel (= 6.0.6.1)
225+
activerecord (= 6.0.6.1)
226+
activestorage (= 6.0.6.1)
227+
activesupport (= 6.0.6.1)
212228
bundler (>= 1.3.0)
213-
railties (= 5.2.8.1)
229+
railties (= 6.0.6.1)
214230
sprockets-rails (>= 2.0.0)
215-
rails-dom-testing (2.2.0)
231+
rails-dom-testing (2.3.0)
216232
activesupport (>= 5.0.0)
217233
minitest
218234
nokogiri (>= 1.6)
219-
rails-html-sanitizer (1.6.0)
235+
rails-html-sanitizer (1.6.2)
220236
loofah (~> 2.21)
221-
nokogiri (~> 1.14)
222-
railties (5.2.8.1)
223-
actionpack (= 5.2.8.1)
224-
activesupport (= 5.2.8.1)
237+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
238+
railties (6.0.6.1)
239+
actionpack (= 6.0.6.1)
240+
activesupport (= 6.0.6.1)
225241
method_source
226242
rake (>= 0.8.7)
227-
thor (>= 0.19.0, < 2.0)
243+
thor (>= 0.20.3, < 2.0)
228244
rainbow (3.1.1)
229-
rake (13.2.1)
245+
rake (13.3.0)
230246
ransack (2.1.1)
231247
actionpack (>= 5.0)
232248
activerecord (>= 5.0)
@@ -289,41 +305,47 @@ GEM
289305
activesupport (>= 5.2)
290306
sprockets (>= 3.0.0)
291307
strscan (3.1.0)
292-
thor (1.3.1)
308+
thor (1.3.2)
293309
thread_safe (0.3.6)
294-
tilt (2.4.0)
295-
timeout (0.4.1)
310+
tilt (2.6.0)
311+
timeout (0.4.3)
296312
tzinfo (1.2.11)
297313
thread_safe (~> 0.1)
298314
unicode-display_width (1.6.1)
299315
warden (1.2.9)
300316
rack (>= 2.0.9)
301-
websocket-driver (0.7.6)
317+
webrick (1.9.1)
318+
websocket-driver (0.8.0)
319+
base64
302320
websocket-extensions (>= 0.1.0)
303321
websocket-extensions (0.1.5)
304322
xpath (3.2.0)
305323
nokogiri (~> 1.8)
324+
zeitwerk (2.6.18)
306325

307326
PLATFORMS
308327
ruby
309328

310329
DEPENDENCIES
311330
activeadmin-mongoid!
312331
capybara
332+
concurrent-ruby (= 1.3.4)
313333
devise
314334
jquery-rails
315335
jquery-ui-rails
316336
jslint
317337
launchy
318-
mongoid (= 7.0.0)
338+
mongo (~> 2.16.4)
339+
mongoid (= 7.1.0)
319340
poltergeist
320341
pry-rails
321-
rails (>= 5.2, < 6.1)
342+
rails (~> 6.0.3)
322343
ransack (~> 2.1.0)
323344
ransack-mongoid!
324345
rspec-rails (~> 3.6)
325346
rubocop (= 0.80.0)
326347
simplecov
348+
webrick (~> 1.7)
327349

328350
BUNDLED WITH
329351
2.5.17

activeadmin-mongoid.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ Gem::Specification.new do |gem|
1717
gem.version = ActiveAdmin::Mongoid::VERSION
1818
gem.license = 'MIT'
1919

20-
gem.required_ruby_version = '>= 2.4'
20+
gem.required_ruby_version = '>= 3.0'
2121

2222
gem.add_runtime_dependency 'mongoid', '>= 6.0', '< 8.a'
23-
gem.add_runtime_dependency 'activeadmin', '>= 1.3.0', '<= 3.0.0'
23+
gem.add_runtime_dependency 'activeadmin', '>= 1.3.0', '<= 2.8.0'
2424
gem.add_runtime_dependency 'kaminari-mongoid'
2525
gem.add_runtime_dependency 'jquery-rails'
2626
gem.add_runtime_dependency 'sass-rails', ['>= 3.1.4']

lib/active_admin/mongoid/csv_builder.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ def build(controller, csv)
1111
csv << bom if bom
1212

1313
if column_names
14-
csv << CSV.generate_line(columns.map { |c| encode c.name, options }, csv_options)
14+
csv << CSV.generate_line(columns.map { |c| encode c.name, options }, **csv_options)
1515
end
1616

1717
(1..paginated_collection.total_pages).each do |page|
1818
paginated_collection(page).each do |resource|
1919
resource = controller.send :apply_decorator, resource
20-
csv << CSV.generate_line(build_row(resource, columns, options), csv_options)
20+
csv << CSV.generate_line(build_row(resource, columns, options), **csv_options)
2121
end
2222
end
2323

test_app/app/models/post.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ class Post
1212
field :'author.city.name'
1313

1414
def self.ransack(*args)
15-
16-
binding.pry unless args.first.empty?
17-
1815
super
19-
2016
end
2117

2218
end

test_app/bin/rails

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env ruby
2+
APP_PATH = File.expand_path('../config/application', __dir__)
3+
require_relative '../config/boot'
4+
require 'rails/commands'

test_app/bin/rake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env ruby
2+
require_relative '../config/boot'
3+
require 'rake'
4+
Rake.application.run

0 commit comments

Comments
 (0)