Class: ThreddedCreateApp::Tasks::AddRoadie

Inherits:
Base
  • Object
show all
Defined in:
lib/thredded_create_app/tasks/add_roadie.rb

Instance Attribute Summary

Attributes inherited from Base

#app_hostname, #app_name, #app_path, #gems

Instance Method Summary collapse

Methods inherited from Base

#devise_form_fields_begin_pattern, #initialize, #webpack_js?

Methods included from RunCommand

#run

Methods included from Logging

#log_command, #log_error, #log_info, #log_stderr, #log_verbose, #log_warn, #program_name

Constructor Details

This class inherits a constructor from ThreddedCreateApp::Tasks::Base

Instance Method Details

#after_bundleObject

rubocop:disable Metrics/AbcSize



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/thredded_create_app/tasks/add_roadie.rb', line 16

def after_bundle # rubocop:disable Metrics/AbcSize
  inject_into_file 'app/mailers/application_mailer.rb',
                   after: "ActionMailer::Base\n",
                   content: "  include Roadie::Rails::Automatic\n"
  inject_into_file 'config/environments/test.rb',
                   before: /\nend\n\z$/,
                   content: indent(2, "\n" + roadie_development_config)
  inject_into_file 'config/environments/development.rb',
                   before: /\nend\n\z$/,
                   content: indent(2, "\n" + roadie_development_config)
  inject_into_file 'config/environments/production.rb',
                   before: /\nend\n\z$/,
                   content: indent(2, "\n" + roadie_production_config)
  replace 'app/views/layouts/mailer.html.erb',
          %r{ *<style>.*?</style>\n}m,
          indent(4, mailer_template_head)
  git_commit 'Add Roadie configuration'
end

#before_bundleObject



11
12
13
14
# File 'lib/thredded_create_app/tasks/add_roadie.rb', line 11

def before_bundle
  add_gem 'roadie-rails'
  add_gem 'plain-david' # for plain text email generation
end

#summaryObject



7
8
9
# File 'lib/thredded_create_app/tasks/add_roadie.rb', line 7

def summary
  'Add and configure the Roadie email pre-processor'
end