Skip to content

Commit d18cc24

Browse files
committed
appease rubocop
1 parent cfc6153 commit d18cc24

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
inherit_from: .rubocop_todo.yml
22

33
AllCops:
4+
NewCops: enable
5+
46
TargetRubyVersion: 3.3
57
Exclude:
68
- 'db/migrate/*.rb'

.rubocop_todo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2021-12-31 12:20:36 UTC using RuboCop version 1.24.0.
3+
# on 2024-05-26 04:33:44 UTC using RuboCop version 1.64.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ group :development, :test do
6060
end
6161

6262
group :test do
63-
gem 'falcon-capybara', git: 'https://github.com/davidsiaw/falcon-capybara', ref: 'options-hash'
6463
gem 'database_cleaner'
64+
gem 'falcon-capybara', git: 'https://github.com/davidsiaw/falcon-capybara', ref: 'options-hash'
6565
gem 'rspec_junit_formatter'
6666
gem 'selenium-webdriver'
6767
gem 'shoulda-matchers'

config/initializers/sidekiq.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
Sidekiq.configure_server do |config|
4-
config.redis = { url: ENV['REDIS_URL'] }
4+
config.redis = { url: ENV.fetch('REDIS_URL', nil) }
55
end

lib/generators/api/api_generator.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ def pname_of(tokens)
4747
end
4848

4949
def fields
50-
@fields ||= member_list.map do |member|
50+
@fields ||= member_list.to_h do |member|
5151
tokens = member.split(':')
5252
[tokens[0], {
5353
param_name: pname_of(tokens),
5454
param_type: ptype_of(tokens),
5555
full_type: tokens[1]
5656
}]
57-
end.to_h
57+
end
5858
end
5959

6060
private
@@ -128,7 +128,7 @@ def mount_api
128128
" #{mount_statement}",
129129
mount_end].map { |x| "#{x}\n" }
130130

131-
File.open(main_api_path, 'wb') { |file| file.write(result) }
131+
File.binwrite(main_api_path, result)
132132
end
133133

134134
def unmount_api
@@ -138,7 +138,7 @@ def unmount_api
138138
mount_list_sans_statement,
139139
mount_end].map { |x| "#{x}\n" }
140140

141-
File.open(main_api_path, 'wb') { |file| file.write(result) }
141+
File.binwrite(main_api_path, result)
142142
end
143143
end
144144
# rubocop:enable Metrics/ClassLength

spec/rails_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# directory. Alternatively, in the individual `*_spec.rb` files, manually
2424
# require only the support files necessary.
2525
#
26-
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f }
26+
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
2727

2828
# Checks for pending migrations and applies them before tests are run.
2929
# If you are not using ActiveRecord, you can remove these lines.
@@ -37,7 +37,7 @@
3737
# Remember to include global test helpers here
3838
include ConcernHelper
3939

40-
config.fixture_paths = ["#{::Rails.root}/spec/fixtures"]
40+
config.fixture_paths = ["#{Rails.root}/spec/fixtures"]
4141

4242
DatabaseCleaner.allow_remote_database_url = true
4343
config.use_transactional_fixtures = false

0 commit comments

Comments
 (0)