Skip to content

Commit 11cae20

Browse files
committed
Apply rubocop corrections
1 parent 2a0259b commit 11cae20

File tree

7 files changed

+14
-17
lines changed

7 files changed

+14
-17
lines changed

lib/dry/rails/auto_registrars/app.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def relative_path(dir, file_path)
2323
path = super
2424
return path unless dir.start_with?("app")
2525

26-
path.split("/")[1..-1].join("/")
26+
path.split("/")[1..].join("/")
2727
end
2828
end
2929
end

spec/dummies/with-engine/dummy-5.x/dummy/config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
6060

6161
if ENV["RAILS_LOG_TO_STDOUT"].present?
62-
logger = ActiveSupport::Logger.new(STDOUT)
62+
logger = ActiveSupport::Logger.new($stdout)
6363
logger.formatter = config.log_formatter
6464
config.logger = ActiveSupport::TaggedLogging.new(logger)
6565
end

spec/dummies/with-engine/dummy-6.x/dummy/config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
6464

6565
if ENV["RAILS_LOG_TO_STDOUT"].present?
66-
logger = ActiveSupport::Logger.new(STDOUT)
66+
logger = ActiveSupport::Logger.new($stdout)
6767
logger.formatter = config.log_formatter
6868
config.logger = ActiveSupport::TaggedLogging.new(logger)
6969
end

spec/dummies/with-engine/dummy/app/controllers/api_safe_params_callbacks_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ class ApiSafeParamsCallbacksController < ActionController::API
1313
required(:id).value(:integer)
1414
end
1515

16-
def show
17-
end
16+
def show; end
1817
end

spec/dummies/with-engine/dummy/app/controllers/safe_params_callbacks_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ class SafeParamsCallbacksController < ApplicationController
1313
required(:id).value(:integer)
1414
end
1515

16-
def show
17-
end
16+
def show; end
1817
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# frozen_string_literal: true
2+
13
class Container; end

spec/spec_helper.rb

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
SPEC_ROOT = Pathname(__dir__)
1111

12-
Dir[SPEC_ROOT.join("shared/**/*.rb")].each(&method(:require))
13-
Dir[SPEC_ROOT.join("support/**/*.rb")].each(&method(:require))
12+
Dir[SPEC_ROOT.join("shared/**/*.rb")].sort.each(&method(:require))
13+
Dir[SPEC_ROOT.join("support/**/*.rb")].sort.each(&method(:require))
1414

1515
ENV["RAILS_ENV"] ||= "test"
1616

@@ -19,7 +19,6 @@
1919
DUMMY_DIR = WITH_ENGINE ? "with-engine" : "without-engine"
2020
require SPEC_ROOT.join("dummies/#{DUMMY_DIR}/dummy-#{RAILS_VERSION}/dummy/config/environment").to_s
2121

22-
2322
require "rspec/rails"
2423

2524
RSpec.configure do |config|
@@ -36,12 +35,10 @@
3635
end
3736

3837
config.around(production: true) do |example|
39-
begin
40-
prev_env = Rails.env
41-
Rails.env = "production"
42-
example.run
43-
ensure
44-
Rails.env = prev_env
45-
end
38+
prev_env = Rails.env
39+
Rails.env = "production"
40+
example.run
41+
ensure
42+
Rails.env = prev_env
4643
end
4744
end

0 commit comments

Comments
 (0)