Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare aws-sdk-rails 4.2 modularization #164

Merged
merged 5 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,20 @@ jobs:
- rails: main
ruby: jruby-9.4

env:
RAILS_ENV: test
RAILS_VERSION: ${{ matrix.rails }}
steps:
- uses: actions/checkout@v4

- name: Set RAILS_VERSION
run: echo "RAILS_VERSION=${{ matrix.rails }}" >> $GITHUB_ENV

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- uses: actions/checkout@v4

- name: Install gems
run: bundle install
env:
BUNDLE_GEMFILE: gemfiles/rails-${{ matrix.rails }}.gemfile

- name: Test
run: bundle exec rake spec
env:
BUNDLE_GEMFILE: gemfiles/rails-${{ matrix.rails }}.gemfile

rubocop:
runs-on: ubuntu-latest
Expand Down
34 changes: 13 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
.DS_Store

.idea/
.byebug_history
/.bundle
/.yardoc
/doc

Gemfile.lock
/coverage
*.gem
/.release

.idea/
coverage/
.yardoc/
doc/
docs.zip
.release/

gemfiles/*.gemfile.lock
sample-app/Gemfile.lock
sample-app/log
sample-app/tmp
sample-app.zip

test/dummy/db/migrate
test/dummy/log/

spec/dummy/db/test.db-shm
spec/dummy/db/test.db-wal
spec/dummy/db/test.db
spec/dummy/db/schema.rb
spec/dummy/log/
spec/dummy/tmp/
spec/dummy/storage/

sample-app/Gemfile.lock
sample-app/log/
sample-app/tmp/
sample-app.zip
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Metrics/MethodLength:

Naming/FileName:
Exclude:
- 'gemfiles/*.gemfile'
- 'lib/aws-sdk-rails.rb'

Style/BlockComments:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-11-16 00:49:51 UTC using RuboCop version 1.68.0.
# on 2024-11-17 00:20:44 UTC using RuboCop version 1.68.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down
25 changes: 13 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@ source 'https://rubygems.org'

gemspec

gem 'aws-actiondispatch-dynamodb', git: 'https://github.com/aws/aws-actiondispatch-dynamodb-ruby'
gem 'aws-actionmailbox-ses', git: 'https://github.com/aws/aws-actionmailbox-ses-ruby'
gem 'aws-actionmailer-ses', git: 'https://github.com/aws/aws-actionmailer-ses-ruby'
gem 'aws-activejob-sqs', git: 'https://github.com/aws/aws-activejob-sqs-ruby'
gem 'aws-record-rails', git: 'https://github.com/aws/aws-record-rails'

group :development, :test do
gem 'pry'
gem 'rake', require: false

case ENV.fetch('RAILS_VERSION', nil)
when '7.1'
gem 'rails', '~> 7.1.0'
when '7.2'
gem 'rails', '~> 7.2.0'
when '8.0'
gem 'rails', '~> 8.0.0'
else
gem 'rails', github: 'rails/rails'
end

group :development do
gem 'byebug', platforms: :ruby
gem 'pry'
gem 'rubocop'
end

group :test do
gem 'bcrypt'
gem 'minitest-spec-rails'
gem 'rspec-rails'
gem 'webmock'
gem 'rspec'
end

group :docs do
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'rspec/core/rake_task'
require 'rubocop/rake_task'

Dir.glob('**/*.rake').each do |task_file|
Dir.glob('tasks/**/*.rake').each do |task_file|
load task_file
end

Expand Down
5 changes: 0 additions & 5 deletions gemfiles/rails-7.1.gemfile

This file was deleted.

5 changes: 0 additions & 5 deletions gemfiles/rails-7.2.gemfile

This file was deleted.

5 changes: 0 additions & 5 deletions gemfiles/rails-8.0.gemfile

This file was deleted.

5 changes: 0 additions & 5 deletions gemfiles/rails-main.gemfile

This file was deleted.

6 changes: 3 additions & 3 deletions lib/aws/rails/action_mailbox/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# This can be deleted in aws-sdk-rails ~> 5

require 'aws/action_mailbox/ses/rspec'
Aws::Rails::ActionMailbox::Rspec = Aws::ActionMailbox::SES::Rspec
Aws::Rails::ActionMailbox::RSpec = Aws::ActionMailbox::SES::RSpec

Kernel.warn('Aws::Rails::ActionMailbox::Rspec is deprecated in aws-sdk-rails ~> 5. ' \
'Use Aws::ActionMailbox::SES::Rspec instead.')
Kernel.warn('Aws::Rails::ActionMailbox::RSpec is deprecated in aws-sdk-rails ~> 5. ' \
'Use Aws::ActionMailbox::SES::RSpec instead.')
Kernel.warn('Please require "aws/action_mailbox/ses/rspec" instead of "aws/rails/action_mailbox/rspec"')
8 changes: 3 additions & 5 deletions lib/aws/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ class Railtie < ::Rails::Railtie
if %i[ses sesv2].include?(::Rails.application.config.action_mailer.delivery_method)
::Rails.logger.warn(<<~MSG)
** Aws::Rails.add_action_mailer_delivery_method will be removed in aws-sdk-rails ~> 5.
If you are using this feature, please add your desired delivery methods in an initializer
(such as config/initializers/action_mailer.rb):
In `aws-actionmailer-ses ~> 1`, configuration will be set using config settings:

options = { ... SES client options ... }
ActionMailer::Base.add_delivery_method :ses, Aws::ActionMailer::SESMailer, **options
ActionMailer::Base.add_delivery_method :ses_v2, Aws::ActionMailer::SESV2Mailer, **options
config.action_mailer.delivery_method = :ses_v2
config.action_mailer.ses_v2_settings = { region: 'us-west-2' }

Existing Mailer classes have moved namespaces but will continue to work in this major version. **
MSG
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Rails.application.initialize!

require 'rspec/rails'
require 'rspec'

# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
Expand Down