Skip to content

Commit 002c8b2

Browse files
committed
Bump Ruby version to 3.4.9. Fix lots of warning: literal string will be frozen in the future
1 parent 2b17819 commit 002c8b2

8 files changed

Lines changed: 36 additions & 36 deletions

File tree

.ruby-version

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

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG RUBY_VERSION=3.3.10
1+
ARG RUBY_VERSION=3.4.9
22

33
#use ruby base image
44
FROM ruby:$RUBY_VERSION-slim AS base

Gemfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,12 @@ GEM
304304
activerecord
305305
kaminari-core (= 1.2.2)
306306
kaminari-core (1.2.2)
307-
kt-paperclip (7.2.0)
307+
kt-paperclip (7.3.0)
308308
activemodel (>= 4.2.0)
309309
activesupport (>= 4.2.0)
310310
marcel (~> 1.0.1)
311311
mime-types
312-
terrapin (~> 0.6.0)
312+
terrapin (>= 0.6.0, < 2.0)
313313
language_server-protocol (3.17.0.3)
314314
ld-patch (3.3.0)
315315
ebnf (~> 2.4)
@@ -632,7 +632,7 @@ GEM
632632
http-cookie (>= 1.0.2, < 2.0)
633633
mime-types (>= 1.16, < 4.0)
634634
netrc (~> 0.8)
635-
reverse_markdown (2.1.1)
635+
reverse_markdown (3.0.2)
636636
nokogiri
637637
rexml (3.4.4)
638638
rouge (4.1.3)
@@ -739,7 +739,7 @@ GEM
739739
sitemap-parser (0.5.6)
740740
nokogiri (~> 1.6)
741741
typhoeus (>= 0.6, < 2.0)
742-
sitemap_generator (6.3.0)
742+
sitemap_generator (7.0.1)
743743
builder (~> 3.0)
744744
slim (5.1.1)
745745
temple (~> 0.10.0)
@@ -780,8 +780,8 @@ GEM
780780
matrix (~> 0.4)
781781
rdf (~> 3.3)
782782
temple (0.10.4)
783-
terrapin (0.6.0)
784-
climate_control (>= 0.0.3, < 1.0)
783+
terrapin (1.1.1)
784+
climate_control
785785
terser (1.1.17)
786786
execjs (>= 0.3.0, < 3)
787787
thor (1.5.0)
@@ -826,7 +826,7 @@ GEM
826826
activesupport
827827
faraday (~> 2.0)
828828
faraday-follow_redirects
829-
webmock (3.18.1)
829+
webmock (3.26.2)
830830
addressable (>= 2.8.0)
831831
crack (>= 0.3.2)
832832
hashdiff (>= 0.4.0, < 2.0.0)
@@ -837,7 +837,7 @@ GEM
837837
websocket-extensions (0.1.5)
838838
whenever (1.0.0)
839839
chronic (>= 0.6.3)
840-
will_paginate (4.0.0)
840+
will_paginate (4.0.1)
841841
xpath (3.2.0)
842842
nokogiri (~> 1.8)
843843
yaml-ld (0.0.3)

app/helpers/application_helper.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ def twitter_link(username)
251251
end
252252

253253
def info_button(title, opts = {}, &block)
254-
classes = 'btn btn-default has-popover'
255-
classes << " #{opts[:class]}" if opts[:class]
254+
classes = %w(btn btn-default has-popover)
255+
classes << opts[:class] if opts[:class]
256256
title_text = opts[:hide_text] ? '' : title
257257
content_tag(:a, tabindex: 0, class: classes,
258258
data: { toggle: 'popover', placement: 'bottom',
@@ -300,7 +300,7 @@ def tab(text, icon, href, disabled: { check: false }, active: false, count: nil,
300300
options['data-tab-history-update-url'] = true
301301
end
302302

303-
text << " (#{count})" if count
303+
text += " (#{count})" if count
304304

305305
link_to("##{href}", options) do
306306
content_tag(:i, nil, class: icon, 'aria-hidden': 'true') + ' ' + text

app/helpers/materials_helper.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,21 @@ def display_attribute(resource, attribute, show_label: true, title: nil, markdow
8686
end
8787
string = "<p class=\"#{attribute}#{show_label ? ' no-spacing' : ''}\">"
8888
unless value.blank? || value.try(:strip) == 'License Not Specified'
89-
string << "<strong class='text-primary'> #{title || resource.class.human_attribute_name(attribute)}: </strong>" if show_label
89+
string += "<strong class='text-primary'> #{title || resource.class.human_attribute_name(attribute)}: </strong>" if show_label
9090
if list
91-
string << '<ul>'
91+
string += '<ul>'
9292
value.each do |v|
93-
string << "<li>#{v}</li>"
93+
string += "<li>#{v}</li>"
9494
end
95-
string << '</ul>'
95+
string += '</ul>'
9696
elsif expandable
9797
height_limit = expandable.is_a?(Numeric) ? expandable : nil
98-
string << "<div class=\"tess-expandable\"#{" data-height-limit=\"#{height_limit}\"" if height_limit}>" + value.to_s + '</div>'
98+
string += "<div class=\"tess-expandable\"#{" data-height-limit=\"#{height_limit}\"" if height_limit}>" + value.to_s + '</div>'
9999
else
100-
string << value.to_s
100+
string += value.to_s
101101
end
102102
end
103-
string << '</p>'
103+
string += '</p>'
104104
string.html_safe
105105
end
106106

lib/ingestors/bioschemas_ingestor.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ def read(source_url)
3333
output[:totals].each do |key, value|
3434
totals[key] += value
3535
end
36-
no_bioschema_urls << "\n - #{url}" if !source.nil? && output[:totals].values.sum.zero?
36+
no_bioschema_urls += "\n - #{url}" if !source.nil? && output[:totals].values.sum.zero?
3737
end
3838
end
3939

4040
if totals.keys.any?
4141
bioschemas_summary = "Bioschemas summary:\n"
4242
totals.each do |type, count|
43-
bioschemas_summary << "\n - #{type}: #{count}"
43+
bioschemas_summary += "\n - #{type}: #{count}"
4444
end
4545
@messages << bioschemas_summary
4646
end
@@ -115,11 +115,11 @@ def read_content(content, url: nil)
115115
end
116116
message = "#{error} occurred while reading"
117117
if url.present? && url != 'https://example.com'
118-
message << ": #{url} "
118+
message += ": #{url} "
119119
else
120-
message << " the source"
120+
message += " the source"
121121
end
122-
message << ". #{comment}" if comment
122+
message += ". #{comment}" if comment
123123
@messages << message
124124
end
125125

lib/ingestors/oai_pmh_ingestor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def read_oai_rdf(client)
9696
if totals.keys.any?
9797
bioschemas_summary = "Bioschemas summary:\n"
9898
totals.each do |type, count|
99-
bioschemas_summary << "\n - #{type}: #{count}"
99+
bioschemas_summary += "\n - #{type}: #{count}"
100100
end
101101
@messages << bioschemas_summary
102102
end

lib/scraper.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ def scrape(source, user = get_user, index: 0)
114114
end
115115
if validate_source(source)
116116
log t('scraper.messages.valid_source'), 2
117-
output.concat "**Provider:** #{source.content_provider.title}\n\n"
118-
output.concat "<span style='url-wrap'>**URL:** #{source.url}</span>\n\n"
119-
output.concat "**Method:** #{source.ingestor_title}\n\n"
117+
output += "**Provider:** #{source.content_provider.title}\n\n"
118+
output += "<span style='url-wrap'>**URL:** #{source.url}</span>\n\n"
119+
output += "**Method:** #{source.ingestor_title}\n\n"
120120

121121
# get ingestor
122122
ingestor = Ingestors::IngestorFactory.get_ingestor(source.method)
@@ -127,16 +127,16 @@ def scrape(source, user = get_user, index: 0)
127127
# read records
128128
ingestor.read(source.url)
129129
unless ingestor.messages.blank?
130-
output.concat "\n## Reading\n\n"
131-
ingestor.messages.each { |m| output.concat "#{m}\n" }
130+
output += "\n## Reading\n\n"
131+
ingestor.messages.each { |m| output += "#{m}\n" }
132132
ingestor.messages.clear
133133
end
134134

135135
# write resources
136136
ingestor.write(user, source.content_provider, source: source)
137137
unless ingestor.messages.blank?
138-
output.concat "\n## Writing\n\n"
139-
ingestor.messages.each { |m| output.concat "#{m}\n" }
138+
output += "\n## Writing\n\n"
139+
ingestor.messages.each { |m| output += "#{m}\n" }
140140
ingestor.messages.clear
141141
end
142142

@@ -152,13 +152,13 @@ def scrape(source, user = get_user, index: 0)
152152
", rejected[#{source.resources_rejected}]", 2
153153
end
154154
rescue StandardError => e
155-
output.concat "\n**Failed:** #{e.message}\n\n"
155+
output += "\n**Failed:** #{e.message}\n\n"
156156
log "Ingestor: #{ingestor.class} failed with: #{e.message}\t#{e.backtrace[0]}", 2
157157
ensure
158158
source.finished_at = Time.now
159159
run_time = source.finished_at - source_start
160-
output.concat "\n**Finished at:** #{source.finished_at.strftime '%H:%M on %A, %d %B %Y (UTC)'}\n"
161-
output.concat "\n**Run time:** #{run_time.round(2)}s\n"
160+
output += "\n**Finished at:** #{source.finished_at.strftime '%H:%M on %A, %d %B %Y (UTC)'}\n"
161+
output += "\n**Run time:** #{run_time.round(2)}s\n"
162162
source.log = output
163163
begin
164164
# only update enabled sources

0 commit comments

Comments
 (0)