diff options
-rw-r--r-- | lib/rails/generators/installer.rb | 8 | ||||
-rw-r--r-- | lib/tasks/install.rake | 7 | ||||
-rw-r--r-- | test/dummy/app/mailboxes/application_mailbox.rb | 3 | ||||
-rw-r--r-- | test/dummy/config/environments/production.rb | 3 |
4 files changed, 18 insertions, 3 deletions
diff --git a/lib/rails/generators/installer.rb b/lib/rails/generators/installer.rb new file mode 100644 index 0000000000..a2bc4b5412 --- /dev/null +++ b/lib/rails/generators/installer.rb @@ -0,0 +1,8 @@ +say "Copying application_mailbox.rb to app/mailboxes" +copy_file "#{__dir__}/mailbox/templates/application_mailbox.rb", "app/mailboxes/application_mailbox.rb" + +environment <<~end_of_config, env: 'production' + # Prepare the ingress controller used to receive mail + # config.action_mailbox.ingress = :amazon + +end_of_config diff --git a/lib/tasks/install.rake b/lib/tasks/install.rake index 598e30c2d4..0885e2d6a5 100644 --- a/lib/tasks/install.rake +++ b/lib/tasks/install.rake @@ -5,10 +5,11 @@ namespace :action_mailbox do Rake::Task["install:migrations"].clear_comments desc "Copy over the migration" - task install: %w[ environment run_generator copy_migrations ] + task install: %w[ environment run_installer copy_migrations ] - task :run_generator do - system "#{RbConfig.ruby} ./bin/rails generate mailbox application --no-test-framework" + task :run_installer do + installer_template = File.expand_path("../rails/generators/installer.rb", __dir__) + system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{installer_template}" end task :copy_migrations do diff --git a/test/dummy/app/mailboxes/application_mailbox.rb b/test/dummy/app/mailboxes/application_mailbox.rb index 47fb2017d6..be51eb3639 100644 --- a/test/dummy/app/mailboxes/application_mailbox.rb +++ b/test/dummy/app/mailboxes/application_mailbox.rb @@ -1,2 +1,5 @@ +# frozen_string_literal: true + class ApplicationMailbox < ActionMailbox::Base + # routing /something/i => :somewhere end diff --git a/test/dummy/config/environments/production.rb b/test/dummy/config/environments/production.rb index 2aaa79f620..1731582220 100644 --- a/test/dummy/config/environments/production.rb +++ b/test/dummy/config/environments/production.rb @@ -1,4 +1,7 @@ Rails.application.configure do + # Prepare the ingress controller used to receive mail + # config.action_mailbox.ingress = :amazon + # Verifies that versions and hashed value of the package contents in the project's package.json config.webpacker.check_yarn_integrity = false # Settings specified here will take precedence over those in config/application.rb. |