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 Dec 6, 2023
1 parent e8a3bc7 commit 3426316
Show file tree
Hide file tree
Showing 26 changed files with 177 additions and 151 deletions.
146 changes: 89 additions & 57 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.2)
actionview (= 7.1.2)
activesupport (= 7.1.2)
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.2)
activesupport (= 7.1.2)
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.2)
activesupport (= 7.1.2)
activerecord (7.1.2)
activemodel (= 7.1.2)
activesupport (= 7.1.2)
timeout (>= 0.4.0)
activesupport (7.1.2)
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.0)
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.4)
bootsnap (1.17.0)
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 @@ -53,12 +63,19 @@ GEM
activesupport
choice (0.2.0)
concurrent-ruby (1.2.2)
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.6.0)
irb (1.10.1)
rdoc
reline (>= 0.3.8)
json (2.7.1)
jsonapi-renderer (0.2.2)
jwt (2.7.1)
kaminari (1.2.2)
Expand All @@ -74,38 +91,45 @@ 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.4)
mini_portile2 (2.8.5)
minitest (5.20.0)
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)
nio4r (2.5.9)
nokogiri (1.15.4)
nio4r (2.7.0)
nokogiri (1.15.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
nokogiri (1.15.5-x86_64-linux)
racc (~> 1.4)
parallel (1.23.0)
parser (3.2.2.3)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
pg (1.2.3)
puma (6.3.1)
psych (5.1.1.1)
stringio
puma (6.4.0)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.8)
racc (1.7.3)
rack (3.0.8)
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 +145,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.2)
actionpack (= 7.1.2)
activesupport (= 7.1.2)
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.1)
psych (>= 4.0.0)
regexp_parser (2.8.3)
reline (0.4.1)
io-console (~> 0.5)
rexml (3.2.6)
rubocop (1.56.3)
base64 (~> 0.1.1)
rubocop (1.58.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 3.2.2.4)
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-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.21.0)
rubocop-rails (2.22.2)
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 +193,24 @@ 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.6.9)
mini_portile2 (~> 2.8.0)
sqlite3 (1.6.6-x86_64-linux)
sshkit (1.21.5)
sqlite3 (1.6.9-x86_64-linux)
sshkit (1.21.6)
net-scp (>= 1.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.12)

PLATFORMS
ruby
Expand Down
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/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/file/iso8601.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Iso8601 < Base
TIME_GLOB = '[0-2][0-9][0-5][0-9][0-5][0-9]{+,-}[0-2][0-9][0-5]0' # HHMMSS+ZZZZ
DURATION_GLOB = DIGIT_GLOB * 3 # ddd, minutes
PERIOD_GLOB = 'PT{*H,*M,*S}' # ISO time period, e.g. PT1H30M
FILENAME_GLOB = "#{DATE_GLOB}T#{TIME_GLOB}_{#{DURATION_GLOB},#{PERIOD_GLOB}}"
FILENAME_GLOB = "#{DATE_GLOB}T#{TIME_GLOB}_{#{DURATION_GLOB},#{PERIOD_GLOB}}".freeze

self.pending_glob = "#{FILENAME_GLOB}.*"
self.imported_glob = "#{FILENAME_GLOB}#{IMPORTED_SUFFIX}.*"
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 3426316

Please sign in to comment.