Class: NgToaster::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/ng-toaster/install/install_generator.rb,
lib/generators/ng-toaster/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_markedObject



12
13
14
15
16
17
# File 'lib/generators/ng-toaster/install/install_generator.rb', line 12

def copy_marked
  say_status("copying js", "NgToaster (#{NgToaster::Rails::TOASTER_VERSION})", :green)
  copy_file "toaster.js", "public/javascripts/toaster.js"
  say_status("copying css", "NgToaster (#{NgToaster::Rails::TOASTER_VERSION})", :green)
  copy_file "toaster.css", "public/stylesheets/toaster.css"
end

#do_nothingObject



27
28
29
30
31
32
33
34
# File 'lib/generators/ng-toaster/install/install_generator.rb', line 27

def do_nothing
  say_status("deprecated", "You are using Rails >= 3.1 with the asset pipeline enabled, so this generator is not needed.")
  say_status("", "The necessary files are already in your asset pipeline.")
  say_status("", "Just add `//= require toaster` to your app/assets/javascripts/application.js")
  say_status("", "Just add `*= require toaster` to your app/assets/stylesheets/application.css")
  say_status("", "If you upgraded your app from Rails < 3.1 and still have toaster.js/css in your assets, be sure to remove them.")
  say_status("", "If you do not want the asset pipeline enabled, you may turn it off in application.rb and re-run this generator.")
end