diff options
author | David Gil <dgilperez@gmail.com> | 2018-12-14 21:40:04 +0100 |
---|---|---|
committer | David Gil <dgilperez@gmail.com> | 2018-12-14 21:40:04 +0100 |
commit | 5c3f0d2e19bfe56c14c9fbea213e4421003f7b1b (patch) | |
tree | d0aece63cd41d7f9242e442a8bc713323a7e583b /lib | |
parent | d872de3c69a8762834d206d2f080550c39143080 (diff) | |
download | rails-5c3f0d2e19bfe56c14c9fbea213e4421003f7b1b.tar.gz rails-5c3f0d2e19bfe56c14c9fbea213e4421003f7b1b.tar.bz2 rails-5c3f0d2e19bfe56c14c9fbea213e4421003f7b1b.zip |
Uses the new generator to install ApplicationMailbox in action_mailbox:install rake
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/install.rake | 7 | ||||
-rw-r--r-- | lib/templates/installer.rb | 4 | ||||
-rw-r--r-- | lib/templates/mailboxes/application_mailbox.rb | 5 |
3 files changed, 3 insertions, 13 deletions
diff --git a/lib/tasks/install.rake b/lib/tasks/install.rake index cfc06fbb5f..1f4c071494 100644 --- a/lib/tasks/install.rake +++ b/lib/tasks/install.rake @@ -5,11 +5,10 @@ namespace :action_mailbox do Rake::Task["install:migrations"].clear_comments desc "Copy over the migration" - task install: %w[ environment run_installer copy_migrations ] + task install: %w[ environment run_generator copy_migrations ] - task :run_installer do - installer_template = File.expand_path("../templates/installer.rb", __dir__) - system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{installer_template}" + task :run_generator do + system "#{RbConfig.ruby} ./bin/rails generate mailbox application" end task :copy_migrations do diff --git a/lib/templates/installer.rb b/lib/templates/installer.rb deleted file mode 100644 index 18a562c0e5..0000000000 --- a/lib/templates/installer.rb +++ /dev/null @@ -1,4 +0,0 @@ -say "Copying application_mailbox.rb to app/mailboxes" -copy_file "#{__dir__}/mailboxes/application_mailbox.rb", "app/mailboxes/application_mailbox.rb" - -environment "# Prepare the ingress controller used to receive mail\n# config.action_mailbox.ingress = :amazon\n\n", env: 'production' diff --git a/lib/templates/mailboxes/application_mailbox.rb b/lib/templates/mailboxes/application_mailbox.rb deleted file mode 100644 index be51eb3639..0000000000 --- a/lib/templates/mailboxes/application_mailbox.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -class ApplicationMailbox < ActionMailbox::Base - # routing /something/i => :somewhere -end |