Skip to content

Commit

Permalink
Fix CI (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp authored Sep 27, 2023
1 parent 32e1273 commit 89ad0d7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion aws-sdk-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
spec.name = 'aws-sdk-rails'
spec.version = version
spec.authors = ['Amazon Web Services']
spec.email = ['mamuller@amazon.com', 'alexwoo@amazon.com']
spec.email = ['aws-dr-rubygems@amazon.com']

spec.summary = 'AWS SDK for Ruby on Rails Plugin'
spec.description = 'Integrates the AWS Ruby SDK with Ruby on Rails'
Expand Down
4 changes: 2 additions & 2 deletions lib/action_dispatch/session/dynamodb_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DynamodbStore < Aws::SessionStore::DynamoDB::RackMiddleware
include SessionObject

def initialize(app, options = {})
options[:config_file] ||= config_file if config_file.exist?
options[:config_file] ||= config_file if File.exist?(config_file)
options[:secret_key] ||= Rails.application.secret_key_base
super
end
Expand All @@ -28,7 +28,7 @@ def initialize(app, options = {})

def config_file
file = Rails.root.join("config/dynamo_db_session_store/#{Rails.env}.yml")
file = Rails.root.join('config/dynamo_db_session_store.yml') unless file.exist?
file = Rails.root.join('config/dynamo_db_session_store.yml') unless File.exist?(file)
file
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/aws/rails/sqs_active_job/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Configuration
:shutdown_timeout, :client, :logger,
:async_queue_error_handler, :message_group_id

# Don't use this method directly: Confugration is a singleton class, use
# Don't use this method directly: Configuration is a singleton class, use
# +Aws::Rails::SqsActiveJob.config+ to access the singleton config.
#
# @param [Hash] options
Expand Down Expand Up @@ -84,7 +84,7 @@ class Configuration
# @option options [SQS::Client] :client SQS Client to use. A default
# client will be created if none is provided.
def initialize(options = {})
options[:config_file] ||= config_file if config_file.exist?
options[:config_file] ||= config_file if File.exist?(config_file)
options = DEFAULTS
.merge(file_options(options))
.merge(options)
Expand Down Expand Up @@ -144,7 +144,7 @@ def file_options(options = {})

def config_file
file = ::Rails.root.join("config/aws_sqs_active_job/#{::Rails.env}.yml")
file = ::Rails.root.join('config/aws_sqs_active_job.yml') unless file.exist?
file = ::Rails.root.join('config/aws_sqs_active_job.yml') unless File.exist?(file)
file
end

Expand Down
2 changes: 1 addition & 1 deletion sample_app/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
if File.exist?(Rails.root.join('tmp', 'caching-dev.txt'))
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true

Expand Down
4 changes: 2 additions & 2 deletions test/aws/rails/sqs_active_job/configuration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ module SqsActiveJob
}
end
it 'configures defaults without runtime or YAML options' do
allow_any_instance_of(Pathname).to receive(:exist?).and_return(false)
allow(File).to receive(:exist?).and_return(false)
cfg = Aws::Rails::SqsActiveJob::Configuration.new
expect(cfg.to_h).to include(Aws::Rails::SqsActiveJob::Configuration::DEFAULTS)
end

it 'merges runtime options with default options' do
allow_any_instance_of(Pathname).to receive(:exist?).and_return(false)
allow(File).to receive(:exist?).and_return(false)
cfg = Aws::Rails::SqsActiveJob::Configuration.new(shutdown_timeout: 360)
expect(cfg.shutdown_timeout).to eq 360
end
Expand Down
1 change: 1 addition & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require 'minitest/autorun'
require 'minitest/spec'
require 'minitest/unit'
require 'rspec/mocks/minitest_integration'
require 'rspec/expectations/minitest_integration'

Expand Down

0 comments on commit 89ad0d7

Please sign in to comment.