aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rails
diff options
context:
space:
mode:
authorDino Maric <dino.onex@gmail.com>2018-12-15 13:41:23 +0100
committerDino Maric <dino.onex@gmail.com>2018-12-15 16:33:39 +0100
commit8415a6c5cf883f7ce6fe93b80ec99072fb04be83 (patch)
tree17a4e88934c3f9dee74ef9ce880acb3d8869645e /lib/rails
parent749e923539075eef407e5d9b8c7c151a3b3171d4 (diff)
downloadrails-8415a6c5cf883f7ce6fe93b80ec99072fb04be83.tar.gz
rails-8415a6c5cf883f7ce6fe93b80ec99072fb04be83.tar.bz2
rails-8415a6c5cf883f7ce6fe93b80ec99072fb04be83.zip
Fix Rails generators
1.Don't generate ApplicationMailboxTest when executing installer 2. Hookup test_unit, so console doesn't throw errors
Diffstat (limited to 'lib/rails')
-rw-r--r--lib/rails/generators/mailbox/USAGE12
-rw-r--r--lib/rails/generators/mailbox/mailbox_generator.rb38
-rw-r--r--lib/rails/generators/mailbox/templates/application_mailbox.rb.tt5
-rw-r--r--lib/rails/generators/mailbox/templates/mailbox.rb.tt8
-rw-r--r--lib/rails/generators/mailbox/templates/mailbox_test.rb.tt13
5 files changed, 0 insertions, 76 deletions
diff --git a/lib/rails/generators/mailbox/USAGE b/lib/rails/generators/mailbox/USAGE
deleted file mode 100644
index d679dd63ae..0000000000
--- a/lib/rails/generators/mailbox/USAGE
+++ /dev/null
@@ -1,12 +0,0 @@
-Description:
-============
- Stubs out a new mailbox class in app/mailboxes and invokes your template
- engine and test framework generators.
-
-Example:
-========
- rails generate mailbox inbox
-
- creates a InboxMailbox class and test:
- Mailbox: app/mailboxes/inbox_mailbox.rb
- Test: test/mailboxes/inbox_mailbox_test.rb
diff --git a/lib/rails/generators/mailbox/mailbox_generator.rb b/lib/rails/generators/mailbox/mailbox_generator.rb
deleted file mode 100644
index 5511545a98..0000000000
--- a/lib/rails/generators/mailbox/mailbox_generator.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-module Rails
- module Generators
- class MailboxGenerator < NamedBase
- source_root File.expand_path("templates", __dir__)
-
- argument :actions, type: :array, default: [:process], banner: "method method"
-
- def check_class_collision
- class_collisions "#{class_name}Mailbox", "#{class_name}MailboxTest"
- end
-
- def create_mailbox_file
- template "mailbox.rb", File.join("app/mailboxes", class_path, "#{file_name}_mailbox.rb")
-
- in_root do
- if behavior == :invoke && !File.exist?(application_mailbox_file_name)
- template "application_mailbox.rb", application_mailbox_file_name
- end
- end
-
- template "mailbox_test.rb", File.join('test/mailboxes', class_path, "#{file_name}_mailbox_test.rb")
- end
-
- hook_for :test_framework
-
- private
- def file_name # :doc:
- @_file_name ||= super.sub(/_mailbox\z/i, "")
- end
-
- def application_mailbox_file_name
- "app/mailboxes/application_mailbox.rb"
- end
- end
- end
-end
diff --git a/lib/rails/generators/mailbox/templates/application_mailbox.rb.tt b/lib/rails/generators/mailbox/templates/application_mailbox.rb.tt
deleted file mode 100644
index be51eb3639..0000000000
--- a/lib/rails/generators/mailbox/templates/application_mailbox.rb.tt
+++ /dev/null
@@ -1,5 +0,0 @@
-# frozen_string_literal: true
-
-class ApplicationMailbox < ActionMailbox::Base
- # routing /something/i => :somewhere
-end
diff --git a/lib/rails/generators/mailbox/templates/mailbox.rb.tt b/lib/rails/generators/mailbox/templates/mailbox.rb.tt
deleted file mode 100644
index 9788bd9bb4..0000000000
--- a/lib/rails/generators/mailbox/templates/mailbox.rb.tt
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class <%= class_name %>Mailbox < ApplicationMailbox
-<% actions.each do |action| -%>
- def <%= action %>
- end
-<% end -%>
-end
diff --git a/lib/rails/generators/mailbox/templates/mailbox_test.rb.tt b/lib/rails/generators/mailbox/templates/mailbox_test.rb.tt
deleted file mode 100644
index 41749808e3..0000000000
--- a/lib/rails/generators/mailbox/templates/mailbox_test.rb.tt
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-require "test_helper"
-
-class <%= class_name %>MailboxTest < ActionMailbox::TestCase
- # test "receive mail" do
- # receive_inbound_email_from_mail \
- # to: '"someone" <someone@example.com>,
- # from: '"else" <else@example.com>',
- # subject: "Hello world!",
- # body: "Hello?"
- # end
-end