Class: Shoestrap::MailcatcherGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/shoestrap/mailcatcher_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_mailcacher_notes_in_readmeObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/shoestrap/mailcatcher_generator.rb', line 14

def add_mailcacher_notes_in_readme
  readme = 'README.md'
  create_file readme unless File.exists? readme
  append_to_file readme, <<-DOCUMENTATION
# Mailcatcher
This application uses Mailcatcher in development mode.
MailCatcher runs a super simple SMTP server which catches any message sent to it to display in a web interface. Run mailcatcher, set your favourite app to deliver to smtp://127.0.0.1:1025 instead of your default SMTP server, then check out http://127.0.0.1:1080 to see the mail that's arrived so far.

For more information inquire http://mailcatcher.me/
  DOCUMENTATION
end

#add_mailcatcher_configObject



5
6
7
8
9
10
11
12
# File 'lib/generators/shoestrap/mailcatcher_generator.rb', line 5

def add_mailcatcher_config
  application(nil, env: "development") do
    "config.action_mailer.smtp_settings = { address: 'localhost', port: 1025 }"
  end
  application(nil, env: "development") do
    "config.action_mailer.delivery_method = :smtp"
  end
end