Class: Fullstack::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#action_mailerObject



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/generators/fullstack/install_generator.rb', line 38

def action_mailer
  inject_into_file("config/environments/production.rb",  :after => "Application.configure do\n") do
<<-eos

  config.action_mailer.default_url_options = { :host => Settings.app.host }
  config.action_mailer.delivery_method = :sendmail
  config.action_mailer.raise_delivery_errors = false

eos
  end
end

#avoid_assets_included_twice_in_developmentObject



50
51
52
# File 'lib/generators/fullstack/install_generator.rb', line 50

def avoid_assets_included_twice_in_development
  gsub_file("config/environments/development.rb", "config.assets.debug = true", "config.assets.debug = false")
end

#fullstack_templatesObject

Copy fullstack templates



13
14
15
16
# File 'lib/generators/fullstack/install_generator.rb', line 13

def fullstack_templates
  directory "config", Rails.root.join("config")
  empty_directory Rails.root.join("lib/support")
end

#gitignoreObject



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/generators/fullstack/install_generator.rb', line 24

def gitignore
  append_to_file '.gitignore' do
<<-eos
.DS_Store
/public/uploads
/public/attachments
/public/assets
*.tmproj
tmtags

eos
  end
end

#install_deviseObject



18
19
20
21
22
# File 'lib/generators/fullstack/install_generator.rb', line 18

def install_devise
  generate "devise:install"
  gsub_file('config/initializers/devise.rb', "\"[email protected]\"", "Settings.app.email")
  generate "remoting:install --host='#{host}' --user='#{user}'"
end