Class: Thecore::ThecorizeAppGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Thecore::ThecorizeAppGenerator
- Defined in:
- lib/generators/thecore/thecorize_app/thecorize_app_generator.rb
Instance Method Summary collapse
-
#adapt_application_controller_to_devise ⇒ Object
TODO: remove from application controller the protect_from_forgery with: :exception part.
-
#manage_assets ⇒ Object
TODO: Must add *= require thecore to application.css before */ //= require thecore to application.js before //= require_tree .
- #remove_index ⇒ Object
-
#update_or_init_git_remote ⇒ Object
TODO: add a .gitignore good for Rails and manage git “Traversing the DIR structures it adds git remote URL”, “By checking wether or not the .git folder exists, it inits or changes the url.”.
Instance Method Details
#adapt_application_controller_to_devise ⇒ Object
TODO: remove from application controller the protect_from_forgery with: :exception part
26 27 28 |
# File 'lib/generators/thecore/thecorize_app/thecorize_app_generator.rb', line 26 def adapt_application_controller_to_devise gsub_file 'app/controllers/application_controller.rb', 'protect_from_forgery with: :exception', '' end |
#manage_assets ⇒ Object
TODO: Must add *= require thecore to application.css before */ //= require thecore to application.js before //= require_tree .
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/generators/thecore/thecorize_app/thecorize_app_generator.rb', line 14 def manage_assets inject_into_file 'app/assets/javascripts/application.js', before: "//= require_tree ." do <<-'RUBY' puts "//= require thecore" RUBY end inject_into_file 'app/assets/stylesheets/application.css', before: "*/ ." do <<-'RUBY' puts "*= require thecore" RUBY end end |
#remove_index ⇒ Object
6 7 8 9 |
# File 'lib/generators/thecore/thecorize_app/thecorize_app_generator.rb', line 6 def remove_index #remove the index.html remove_file 'public/index.html' end |
#update_or_init_git_remote ⇒ Object
TODO: add a .gitignore good for Rails and manage git “Traversing the DIR structures it adds git remote URL”, “By checking wether or not the .git folder exists, it inits or changes the url.”
32 33 34 35 |
# File 'lib/generators/thecore/thecorize_app/thecorize_app_generator.rb', line 32 def update_or_init_git_remote say "Manage Git", :green rails_command "g thecore:add_git #{@name}" end |