Class: KeyboardJS::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_javascriptObject



11
12
13
14
# File 'lib/generators/keyboardjs/install/install_generator.rb', line 11

def copy_javascript
  say_status("copying", "KeyboardJS", :green)
  copy_file "javascripts/keyboardjs.js", "public/javascripts/keyboardjs.js"
end

#do_nothingObject



24
25
26
27
28
29
30
31
# File 'lib/generators/keyboardjs/install/install_generator.rb', line 24

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 keyboardjs` to your app/assets/javascripts/application.js")
  say_status("", "If you upgraded your app from Rails 3.0 and still have keyboardjs.js in your public assets folders, 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.")
  # ok, nothing
end