Class: Gintonic::JsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Gintonic::JsGenerator
- Defined in:
- lib/generators/gintonic/js/js_generator.rb
Instance Method Summary collapse
- #copy_application_js ⇒ Object
- #copy_ready_js ⇒ Object
- #create_structure ⇒ Object
- #install_jquery_turbolinks ⇒ Object
Instance Method Details
#copy_application_js ⇒ Object
15 16 17 18 |
# File 'lib/generators/gintonic/js/js_generator.rb', line 15 def copy_application_js template 'application.js', File.join(destination_root, 'app/assets/javascripts/application.js') end |
#copy_ready_js ⇒ Object
10 11 12 13 |
# File 'lib/generators/gintonic/js/js_generator.rb', line 10 def copy_ready_js template 'ready.js', File.join(destination_root, 'app/assets/javascripts/ready.js') end |
#create_structure ⇒ Object
4 5 6 7 8 |
# File 'lib/generators/gintonic/js/js_generator.rb', line 4 def create_structure create_file "app/assets/javascripts/libs/.keep", "" create_file "app/assets/javascripts/modules/.keep", "" create_file "app/assets/javascripts/blocks/.keep", "" end |
#install_jquery_turbolinks ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/generators/gintonic/js/js_generator.rb', line 20 def install_jquery_turbolinks begin gem 'jquery-turbolinks' rescue Errno::ENOENT say_status("warning", "It seems you don't have any Gemfile. I hope you are in the dummy app.", :yellow) end end |