Skip to content

Commit eec0b45

Browse files
committed
refactor(url): consolidate URL helper logic and update dependencies
tech-conferences#100 Move URL helper logic from app/lib to lib directory and simplify implementation Update Rails version to 7.1.3 and related gem dependencies Fix topic model to return nil in else case and add related topics in conference model
1 parent 8555395 commit eec0b45

File tree

8 files changed

+158
-102
lines changed

8 files changed

+158
-102
lines changed

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ end
1010
gem 'administrate', '~> 0.20.1'
1111
gem 'algolia', '~> 2.0.4'
1212
gem 'chronic'
13-
gem 'loofah', '~> 2.3.1'
13+
gem 'loofah', '~> 2.21'
1414
gem 'pg'
1515
gem 'puma', '~> 5.6.4'
16-
gem 'rails', '~> 6.1.7.8'
16+
gem 'rails', '~> 7.1.3'
1717
gem 'sidekiq', '~> 6.5.10'
1818
gem 'simple_command'
1919
gem 'twitter', '~> 7.0.0'
@@ -40,7 +40,7 @@ gem 'rack-cors', :require => 'rack/cors'
4040
gem 'jwt'
4141

4242
group :test do
43-
gem 'mocha', '1.7.0', require: false
43+
gem 'mocha', '~> 2.0', require: false
4444
gem 'webmock'
4545
end
4646

Gemfile.lock

Lines changed: 126 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,83 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (6.1.7.8)
5-
actionpack (= 6.1.7.8)
6-
activesupport (= 6.1.7.8)
4+
actioncable (7.1.5.1)
5+
actionpack (= 7.1.5.1)
6+
activesupport (= 7.1.5.1)
77
nio4r (~> 2.0)
88
websocket-driver (>= 0.6.1)
9-
actionmailbox (6.1.7.8)
10-
actionpack (= 6.1.7.8)
11-
activejob (= 6.1.7.8)
12-
activerecord (= 6.1.7.8)
13-
activestorage (= 6.1.7.8)
14-
activesupport (= 6.1.7.8)
9+
zeitwerk (~> 2.6)
10+
actionmailbox (7.1.5.1)
11+
actionpack (= 7.1.5.1)
12+
activejob (= 7.1.5.1)
13+
activerecord (= 7.1.5.1)
14+
activestorage (= 7.1.5.1)
15+
activesupport (= 7.1.5.1)
1516
mail (>= 2.7.1)
16-
actionmailer (6.1.7.8)
17-
actionpack (= 6.1.7.8)
18-
actionview (= 6.1.7.8)
19-
activejob (= 6.1.7.8)
20-
activesupport (= 6.1.7.8)
17+
net-imap
18+
net-pop
19+
net-smtp
20+
actionmailer (7.1.5.1)
21+
actionpack (= 7.1.5.1)
22+
actionview (= 7.1.5.1)
23+
activejob (= 7.1.5.1)
24+
activesupport (= 7.1.5.1)
2125
mail (~> 2.5, >= 2.5.4)
22-
rails-dom-testing (~> 2.0)
23-
actionpack (6.1.7.8)
24-
actionview (= 6.1.7.8)
25-
activesupport (= 6.1.7.8)
26-
rack (~> 2.0, >= 2.0.9)
26+
net-imap
27+
net-pop
28+
net-smtp
29+
rails-dom-testing (~> 2.2)
30+
actionpack (7.1.5.1)
31+
actionview (= 7.1.5.1)
32+
activesupport (= 7.1.5.1)
33+
nokogiri (>= 1.8.5)
34+
racc
35+
rack (>= 2.2.4)
36+
rack-session (>= 1.0.1)
2737
rack-test (>= 0.6.3)
28-
rails-dom-testing (~> 2.0)
29-
rails-html-sanitizer (~> 1.0, >= 1.2.0)
30-
actiontext (6.1.7.8)
31-
actionpack (= 6.1.7.8)
32-
activerecord (= 6.1.7.8)
33-
activestorage (= 6.1.7.8)
34-
activesupport (= 6.1.7.8)
38+
rails-dom-testing (~> 2.2)
39+
rails-html-sanitizer (~> 1.6)
40+
actiontext (7.1.5.1)
41+
actionpack (= 7.1.5.1)
42+
activerecord (= 7.1.5.1)
43+
activestorage (= 7.1.5.1)
44+
activesupport (= 7.1.5.1)
45+
globalid (>= 0.6.0)
3546
nokogiri (>= 1.8.5)
36-
actionview (6.1.7.8)
37-
activesupport (= 6.1.7.8)
47+
actionview (7.1.5.1)
48+
activesupport (= 7.1.5.1)
3849
builder (~> 3.1)
39-
erubi (~> 1.4)
40-
rails-dom-testing (~> 2.0)
41-
rails-html-sanitizer (~> 1.1, >= 1.2.0)
42-
activejob (6.1.7.8)
43-
activesupport (= 6.1.7.8)
50+
erubi (~> 1.11)
51+
rails-dom-testing (~> 2.2)
52+
rails-html-sanitizer (~> 1.6)
53+
activejob (7.1.5.1)
54+
activesupport (= 7.1.5.1)
4455
globalid (>= 0.3.6)
45-
activemodel (6.1.7.8)
46-
activesupport (= 6.1.7.8)
47-
activerecord (6.1.7.8)
48-
activemodel (= 6.1.7.8)
49-
activesupport (= 6.1.7.8)
50-
activestorage (6.1.7.8)
51-
actionpack (= 6.1.7.8)
52-
activejob (= 6.1.7.8)
53-
activerecord (= 6.1.7.8)
54-
activesupport (= 6.1.7.8)
56+
activemodel (7.1.5.1)
57+
activesupport (= 7.1.5.1)
58+
activerecord (7.1.5.1)
59+
activemodel (= 7.1.5.1)
60+
activesupport (= 7.1.5.1)
61+
timeout (>= 0.4.0)
62+
activestorage (7.1.5.1)
63+
actionpack (= 7.1.5.1)
64+
activejob (= 7.1.5.1)
65+
activerecord (= 7.1.5.1)
66+
activesupport (= 7.1.5.1)
5567
marcel (~> 1.0)
56-
mini_mime (>= 1.1.0)
57-
activesupport (6.1.7.8)
68+
activesupport (7.1.5.1)
69+
base64
70+
benchmark (>= 0.3)
71+
bigdecimal
5872
concurrent-ruby (~> 1.0, >= 1.0.2)
73+
connection_pool (>= 2.2.5)
74+
drb
5975
i18n (>= 1.6, < 2)
76+
logger (>= 1.4.2)
6077
minitest (>= 5.1)
78+
mutex_m
79+
securerandom (>= 0.3)
6180
tzinfo (~> 2.0)
62-
zeitwerk (~> 2.3)
6381
addressable (2.8.7)
6482
public_suffix (>= 2.0.2, < 7.0)
6583
administrate (0.20.1)
@@ -77,6 +95,7 @@ GEM
7795
ast (2.4.2)
7896
base64 (0.3.0)
7997
bcrypt (3.1.20)
98+
benchmark (0.4.1)
8099
better_errors (2.10.1)
81100
erubi (>= 1.0.0)
82101
rack (>= 0.9.0)
@@ -95,7 +114,7 @@ GEM
95114
bigdecimal
96115
rexml
97116
crass (1.0.6)
98-
date (3.3.4)
117+
date (3.4.1)
99118
debug_inspector (1.2.0)
100119
devise (4.9.4)
101120
bcrypt (~> 3.0)
@@ -109,7 +128,9 @@ GEM
109128
dotenv-rails (3.1.2)
110129
dotenv (= 3.1.2)
111130
railties (>= 6.1)
131+
drb (2.2.3)
112132
equalizer (0.0.11)
133+
erb (5.0.2)
113134
erubi (1.13.0)
114135
execjs (2.9.1)
115136
faraday (1.10.3)
@@ -159,6 +180,10 @@ GEM
159180
i18n (1.14.5)
160181
concurrent-ruby (~> 1.0)
161182
io-console (0.7.2)
183+
irb (1.15.2)
184+
pp (>= 0.6.0)
185+
rdoc (>= 4.0.0)
186+
reline (>= 0.4.2)
162187
jquery-rails (4.6.0)
163188
rails-dom-testing (>= 1, < 3)
164189
railties (>= 4.2.0)
@@ -183,9 +208,9 @@ GEM
183208
rb-fsevent (~> 0.9, >= 0.9.4)
184209
rb-inotify (~> 0.9, >= 0.9.7)
185210
logger (1.6.0)
186-
loofah (2.3.1)
211+
loofah (2.24.1)
187212
crass (~> 1.0.2)
188-
nokogiri (>= 1.5.9)
213+
nokogiri (>= 1.12.0)
189214
mail (2.8.1)
190215
mini_mime (>= 0.1.1)
191216
net-imap
@@ -194,25 +219,25 @@ GEM
194219
marcel (1.0.4)
195220
memoizable (0.4.2)
196221
thread_safe (~> 0.3, >= 0.3.1)
197-
metaclass (0.0.4)
198222
method_source (1.1.0)
199223
mini_mime (1.1.5)
200224
minitest (5.24.1)
201-
mocha (1.7.0)
202-
metaclass (~> 0.0.1)
225+
mocha (2.7.1)
226+
ruby2_keywords (>= 0.0.5)
203227
multi_json (1.15.0)
204228
multipart-post (2.4.1)
229+
mutex_m (0.3.0)
205230
naught (1.1.0)
206231
net-http-persistent (4.0.2)
207232
connection_pool (~> 2.2)
208-
net-imap (0.4.14)
233+
net-imap (0.5.9)
209234
date
210235
net-protocol
211236
net-pop (0.1.2)
212237
net-protocol
213238
net-protocol (0.2.2)
214239
timeout
215-
net-smtp (0.5.0)
240+
net-smtp (0.5.1)
216241
net-protocol
217242
nio4r (2.7.3)
218243
nokogiri (1.16.7-arm64-darwin)
@@ -229,6 +254,9 @@ GEM
229254
ast (~> 2.4.1)
230255
racc
231256
pg (1.5.7)
257+
pp (0.6.2)
258+
prettyprint
259+
prettyprint (0.2.0)
232260
progress_bar (1.3.4)
233261
highline (>= 1.6)
234262
options (~> 2.3.0)
@@ -240,47 +268,60 @@ GEM
240268
pry (>= 0.13, < 0.15)
241269
pry-rails (0.3.11)
242270
pry (>= 0.13.0)
271+
psych (5.2.6)
272+
date
273+
stringio
243274
public_suffix (6.0.1)
244275
puma (5.6.8)
245276
nio4r (~> 2.0)
246277
racc (1.8.1)
247278
rack (2.2.17)
248279
rack-cors (2.0.2)
249280
rack (>= 2.0.0)
281+
rack-session (1.0.2)
282+
rack (< 3)
250283
rack-test (2.1.0)
251284
rack (>= 1.3)
252-
rails (6.1.7.8)
253-
actioncable (= 6.1.7.8)
254-
actionmailbox (= 6.1.7.8)
255-
actionmailer (= 6.1.7.8)
256-
actionpack (= 6.1.7.8)
257-
actiontext (= 6.1.7.8)
258-
actionview (= 6.1.7.8)
259-
activejob (= 6.1.7.8)
260-
activemodel (= 6.1.7.8)
261-
activerecord (= 6.1.7.8)
262-
activestorage (= 6.1.7.8)
263-
activesupport (= 6.1.7.8)
285+
rackup (1.0.1)
286+
rack (< 3)
287+
webrick
288+
rails (7.1.5.1)
289+
actioncable (= 7.1.5.1)
290+
actionmailbox (= 7.1.5.1)
291+
actionmailer (= 7.1.5.1)
292+
actionpack (= 7.1.5.1)
293+
actiontext (= 7.1.5.1)
294+
actionview (= 7.1.5.1)
295+
activejob (= 7.1.5.1)
296+
activemodel (= 7.1.5.1)
297+
activerecord (= 7.1.5.1)
298+
activestorage (= 7.1.5.1)
299+
activesupport (= 7.1.5.1)
264300
bundler (>= 1.15.0)
265-
railties (= 6.1.7.8)
266-
sprockets-rails (>= 2.0.0)
301+
railties (= 7.1.5.1)
267302
rails-dom-testing (2.2.0)
268303
activesupport (>= 5.0.0)
269304
minitest
270305
nokogiri (>= 1.6)
271-
rails-html-sanitizer (1.4.3)
272-
loofah (~> 2.3)
273-
railties (6.1.7.8)
274-
actionpack (= 6.1.7.8)
275-
activesupport (= 6.1.7.8)
276-
method_source
306+
rails-html-sanitizer (1.6.0)
307+
loofah (~> 2.21)
308+
nokogiri (~> 1.14)
309+
railties (7.1.5.1)
310+
actionpack (= 7.1.5.1)
311+
activesupport (= 7.1.5.1)
312+
irb
313+
rackup (>= 1.0.0)
277314
rake (>= 12.2)
278-
thor (~> 1.0)
315+
thor (~> 1.0, >= 1.2.2)
316+
zeitwerk (~> 2.6)
279317
rainbow (3.1.1)
280318
rake (13.2.1)
281319
rb-fsevent (0.11.2)
282320
rb-inotify (0.11.1)
283321
ffi (~> 1.0)
322+
rdoc (6.14.2)
323+
erb
324+
psych (>= 4.0.0)
284325
redis (4.8.1)
285326
regexp_parser (2.9.2)
286327
reline (0.5.9)
@@ -345,6 +386,7 @@ GEM
345386
sawyer (0.9.2)
346387
addressable (>= 2.3.5)
347388
faraday (>= 0.17.3, < 3)
389+
securerandom (0.4.1)
348390
selectize-rails (0.12.6)
349391
selenium-webdriver (4.23.0)
350392
base64 (~> 0.2)
@@ -369,11 +411,12 @@ GEM
369411
actionpack (>= 6.1)
370412
activesupport (>= 6.1)
371413
sprockets (>= 3.0.0)
414+
stringio (3.1.7)
372415
strscan (3.1.0)
373416
thor (1.3.1)
374417
thread_safe (0.3.6)
375418
tilt (2.6.1)
376-
timeout (0.4.1)
419+
timeout (0.4.3)
377420
twitter (7.0.0)
378421
addressable (~> 2.3)
379422
buftok (~> 0.2.0)
@@ -399,14 +442,17 @@ GEM
399442
addressable (>= 2.8.0)
400443
crack (>= 0.3.2)
401444
hashdiff (>= 0.4.0, < 2.0.0)
445+
webrick (1.9.1)
402446
websocket (1.2.11)
403-
websocket-driver (0.7.6)
447+
websocket-driver (0.8.0)
448+
base64
404449
websocket-extensions (>= 0.1.0)
405450
websocket-extensions (0.1.5)
406451
zeitwerk (2.6.17)
407452

408453
PLATFORMS
409454
arm64-darwin-23
455+
arm64-darwin-24
410456
x86_64-linux
411457

412458
DEPENDENCIES
@@ -421,16 +467,16 @@ DEPENDENCIES
421467
faraday
422468
jwt
423469
listen (>= 3.0.5, < 3.2)
424-
loofah (~> 2.3.1)
425-
mocha (= 1.7.0)
470+
loofah (~> 2.21)
471+
mocha (~> 2.0)
426472
octokit (~> 4.0)
427473
pg
428474
progress_bar (~> 1.3.0)
429475
pry-byebug
430476
pry-rails
431477
puma (~> 5.6.4)
432478
rack-cors
433-
rails (~> 6.1.7.8)
479+
rails (~> 7.1.3)
434480
rspec-rails (~> 6.1.3)
435481
rss (~> 0.2.9)
436482
rubocop (~> 1.65.1)

app/helpers/url_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module UrlHelper
2+
def self.fix_url(url)
3+
# Basic stub: ensure url starts with http(s)
4+
return nil if url.nil?
5+
url =~ /^https?:\/\// ? url : "https://#{url}"
6+
end
7+
end

0 commit comments

Comments
 (0)