Skip to content

Commit

Permalink
Update to rails 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
codez committed Feb 21, 2024
1 parent 69d3b4b commit 52d0430
Show file tree
Hide file tree
Showing 31 changed files with 186 additions and 148 deletions.
153 changes: 95 additions & 58 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,43 +1,53 @@
GEM
remote: https://rubygems.org/
specs:
actionpack (7.0.8)
actionview (= 7.0.8)
activesupport (= 7.0.8)
rack (~> 2.0, >= 2.2.4)
actionpack (7.1.3.1)
actionview (= 7.1.3.1)
activesupport (= 7.1.3.1)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (7.0.8)
activesupport (= 7.0.8)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actionview (7.1.3.1)
activesupport (= 7.1.3.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.10.13)
actionpack (>= 4.1, < 7.1)
activemodel (>= 4.1, < 7.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
active_model_serializers (0.10.14)
actionpack (>= 4.1)
activemodel (>= 4.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activemodel (7.0.8)
activesupport (= 7.0.8)
activerecord (7.0.8)
activemodel (= 7.0.8)
activesupport (= 7.0.8)
activesupport (7.0.8)
activemodel (7.1.3.1)
activesupport (= 7.1.3.1)
activerecord (7.1.3.1)
activemodel (= 7.1.3.1)
activesupport (= 7.1.3.1)
timeout (>= 0.4.0)
activesupport (7.1.3.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
airbrussh (1.4.2)
airbrussh (1.5.1)
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
base64 (0.1.1)
bootsnap (1.16.0)
base64 (0.2.0)
bigdecimal (3.1.6)
bootsnap (1.18.3)
msgpack (~> 1.2)
builder (3.2.4)
byebug (11.1.3)
capistrano (3.17.3)
capistrano (3.18.0)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
Expand All @@ -52,15 +62,23 @@ GEM
case_transform (0.2)
activesupport
choice (0.2.0)
concurrent-ruby (1.2.2)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
crass (1.0.6)
docile (1.4.0)
drb (2.2.0)
ruby2_keywords
erubi (1.12.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
io-console (0.7.2)
irb (1.11.2)
rdoc
reline (>= 0.4.2)
json (2.7.1)
jsonapi-renderer (0.2.2)
jwt (2.7.1)
jwt (2.8.0)
base64
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
Expand All @@ -74,38 +92,47 @@ GEM
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
language_server-protocol (3.17.0.3)
loofah (2.21.3)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
method_source (1.0.0)
mini_portile2 (2.8.5)
minitest (5.20.0)
minitest (5.22.2)
mocha (2.1.0)
ruby2_keywords (>= 0.0.5)
msgpack (1.7.2)
multi_json (1.15.0)
mutex_m (0.2.0)
net-scp (4.0.0)
net-ssh (>= 2.6.5, < 8.0.0)
net-ssh (7.2.0)
net-sftp (4.0.0)
net-ssh (>= 5.0.0, < 8.0.0)
net-ssh (7.2.1)
nio4r (2.7.0)
nokogiri (1.16.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-linux)
racc (~> 1.4)
parallel (1.23.0)
parser (3.2.2.3)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
pg (1.2.3)
psych (5.1.2)
stringio
puma (6.4.2)
nio4r (~> 2.0)
racc (1.7.3)
rack (2.2.8)
rack (3.0.9.1)
rack-cors (2.0.1)
rack (>= 2.0.0)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
Expand All @@ -121,38 +148,43 @@ GEM
rails-i18n (7.0.8)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
railties (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
method_source
railties (7.1.3.1)
actionpack (= 7.1.3.1)
activesupport (= 7.1.3.1)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.1)
rake (13.1.0)
rdoc (6.6.2)
psych (>= 4.0.0)
regexp_parser (2.9.0)
reline (0.4.2)
io-console (~> 0.5)
rexml (3.2.6)
rubocop (1.56.3)
base64 (~> 0.1.1)
rubocop (1.60.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-performance (1.19.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.21.0)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails (2.23.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-graphviz (1.2.5)
rexml
ruby-progressbar (1.13.0)
Expand All @@ -164,21 +196,26 @@ GEM
simplecov-html (0.12.3)
simplecov-lcov (0.8.0)
simplecov_json_formatter (0.1.4)
spring (4.1.1)
sqlite3 (1.6.6)
spring (4.1.3)
sqlite3 (1.7.2)
mini_portile2 (~> 2.8.0)
sqlite3 (1.6.6-x86_64-linux)
sshkit (1.21.5)
sqlite3 (1.7.2-x86_64-linux)
sshkit (1.22.0)
mutex_m
net-scp (>= 1.1.2)
net-sftp (>= 2.1.2)
net-ssh (>= 2.8.0)
streamio-ffmpeg (3.0.2)
multi_json (~> 1.8)
stringio (3.1.0)
swagger-blocks (3.0.0)
thor (1.2.2)
thor (1.3.0)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)
zeitwerk (2.6.11)
unicode-display_width (2.5.0)
webrick (1.8.1)
zeitwerk (2.6.13)

PLATFORMS
ruby
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ It consists of three main parts:
## License

RAAR is released under the terms of the GNU Affero General Public License.
Copyright 2015-2022 Radio Rabe.
Copyright 2015-today Radio Rabe.
See `LICENSE` for further information.
2 changes: 1 addition & 1 deletion app/controllers/apidocs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def root_json
end

def host_info
secrets = Rails.application.secrets
secrets = Rails.application.settings
{}.tap do |hash|
hash['host'] = secrets.host_name if secrets.host_name.present?
hash['basePath'] = secrets.base_path if secrets.base_path.present?
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/auth/jwt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ def decode(token)
private

def secret
Rails.application.secrets.secret_key_base.to_s
Rails.application.credentials.secret_key_base.to_s
end

def minutes_to_expire
Rails.application.secrets.minutes_to_expire_jwt_token.to_i.minutes
Rails.application.settings.minutes_to_expire_jwt_token.to_i.minutes
end

end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/crud_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def destroy

def entry_url
prefix = self.class.name.deconstantize.underscore.tr('/', '_')
send("#{prefix}_#{entry.class.model_name.singular_route_key}_path", entry)
send(:"#{prefix}_#{entry.class.model_name.singular_route_key}_path", entry)
end

def build_entry
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/login_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def create

def update
set_user_from_remote_header
current_user&.regenerate_api_key!
current_user&.regenerate_api_key
generate_admin_token
render_current_user
end
Expand Down
6 changes: 3 additions & 3 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def to_s
end

def admin?
(listify(groups) & listify(Rails.application.secrets.admin_groups)).present?
(listify(groups) & listify(Rails.application.settings.admin_groups)).present?
end

def groups=(value)
Expand All @@ -52,14 +52,14 @@ def api_token
"#{id}$#{api_key}" if api_key?
end

def regenerate_api_key!
def regenerate_api_key
self.api_key = self.class.generate_unique_secure_token
reset_api_key_expires_at
save!
end

def reset_api_key_expires_at
days = Rails.application.secrets.days_to_expire_api_key
days = Rails.application.settings.days_to_expire_api_key
self.api_key_expires_at = days.present? ? Time.zone.today + days.to_i.days : nil
end

Expand Down
2 changes: 1 addition & 1 deletion app/services/file_store/structure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Structure
class << self

def home
home = Rails.application.secrets.archive_home
home = Rails.application.settings.archive_home
# rubocop:disable Style/GlobalVars
if Rails.env.test? && $TEST_WORKER
File.join(home, $TEST_WORKER.to_s)
Expand Down
2 changes: 1 addition & 1 deletion app/services/import/broadcast_mapping/builder/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def build_default_mapping(started_at, finished_at)

def default_show
@default_show ||= begin
id = Rails.application.secrets.import_default_show_id
id = Rails.application.settings.import_default_show_id
id.present? && Show.find(id)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def fetch_show_name(recording)
def show_name_mapping
@show_name_mapping ||=
if File.exist?(SHOW_NAME_YAML)
YAML.safe_load(File.read(SHOW_NAME_YAML))
YAML.safe_load_file(SHOW_NAME_YAML)
else
{}
end
Expand Down
4 changes: 2 additions & 2 deletions app/services/import/recording/cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def older_than?(recording, days)
end

def days_to_keep_imported
Rails.application.secrets.days_to_keep_imported
Rails.application.settings.days_to_keep_imported
end

def days_to_finish_import
Rails.application.secrets.days_to_finish_import
Rails.application.settings.days_to_finish_import
end

end
Expand Down
2 changes: 1 addition & 1 deletion app/services/import/recording/finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def glob_recordings(pattern)
end

def config_import_directories
Rails.application.secrets.import_directories ||
Rails.application.settings.import_directories ||
raise('IMPORT_DIRECTORIES not set!')
end

Expand Down
2 changes: 1 addition & 1 deletion app/services/parallelizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def next_payload
end

def default_thread_count
Rails.application.secrets.parallel_transcodings.to_i
Rails.application.settings.parallel_transcodings.to_i
end

end
Loading

0 comments on commit 52d0430

Please sign in to comment.