class Thecore::ThecorizeAppGenerator

Public Instance Methods

adapt_application_controller_to_devise() click to toggle source

TODO: remove from application controller the protect_from_forgery with: :exception part

# 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() click to toggle source

TODO: Must add *= require thecore to application.css before */ //= require thecore to application.js before //= require_tree .

# 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() click to toggle source
# 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() click to toggle source

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.”

# 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