lib/generators/mousetrap/install/install_generator.rb in mousetrap-rails-0.0.3 vs lib/generators/mousetrap/install/install_generator.rb in mousetrap-rails-0.0.4

- old
+ new

@@ -6,14 +6,22 @@ def copy_mousetrap copy_file "keybindings.js.coffee", "app/assets/javascripts/keybindings.js.coffee" end - def add_assets + def add_javascript_assets if File.exist?('app/assets/javascripts/application.js') insert_into_file "app/assets/javascripts/application.js", "//= require mousetrap\n", :after => "jquery_ujs\n" else copy_file "application.js", "app/assets/javascripts/application.js" + end + end + + def add_css_assets + if File.exist?('app/assets/stylesheets/application.css') + insert_into_file "app/assets/stylesheets/application.css", "*= require mousetrap\n ", :before => "*= require_tree ." + else + copy_file "application.css", "app/assets/stylesheets/application.css" end end end end end