Class: Kitestrings::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Kitestrings::Generators::InstallGenerator
- Defined in:
- lib/generators/kitestrings/install_generator.rb
Instance Method Summary collapse
- #copy_app_view_files ⇒ Object
- #copy_config_files ⇒ Object
- #copy_haml_files ⇒ Object
- #copy_rspec_files ⇒ Object
- #copy_scaffold_files ⇒ Object
- #copy_spec_ext ⇒ Object
- #setup_application_controller ⇒ Object
- #setup_directories ⇒ Object
Instance Method Details
#copy_app_view_files ⇒ Object
33 34 35 36 37 |
# File 'lib/generators/kitestrings/install_generator.rb', line 33 def copy_app_view_files copy_file "views/application/_navigation.html.haml", "app/views/application/_navigation.html.haml" copy_file "views/layouts/application.html.haml", "app/views/layouts/application.html.haml" copy_file "views/public/403.html", "app/views/public/403.html" end |
#copy_config_files ⇒ Object
11 12 13 14 15 |
# File 'lib/generators/kitestrings/install_generator.rb', line 11 def copy_config_files copy_file "config/deploy.rb", "config/deploy.rb" directory "config/deploy", "config/deploy" directory "config/environments", "config/environments" end |
#copy_haml_files ⇒ Object
17 18 19 |
# File 'lib/generators/kitestrings/install_generator.rb', line 17 def copy_haml_files directory "haml", "lib/templates/haml" end |
#copy_rspec_files ⇒ Object
25 26 27 |
# File 'lib/generators/kitestrings/install_generator.rb', line 25 def copy_rspec_files directory "rspec", "lib/templates/rspec" end |
#copy_scaffold_files ⇒ Object
21 22 23 |
# File 'lib/generators/kitestrings/install_generator.rb', line 21 def copy_scaffold_files directory "rails", "lib/templates/rails" end |
#copy_spec_ext ⇒ Object
29 30 31 |
# File 'lib/generators/kitestrings/install_generator.rb', line 29 def copy_spec_ext directory "spec_ext", "spec_ext" end |
#setup_application_controller ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/generators/kitestrings/install_generator.rb', line 39 def setup_application_controller inject_into_file "app/controllers/application_controller.rb", :after => /protect_from_forgery.*$/ do "\n\n unless Rails.application.config.consider_all_requests_local\n rescue_from CanCan::AccessDenied do |exception|\n# Notify errbit if you would like to:\n# Airbrake.notify(exception)\nrender 'public/403', status: 403, layout: 'none'\n end\n end\n EOF\n end\nend\n" |
#setup_directories ⇒ Object
55 56 57 58 |
# File 'lib/generators/kitestrings/install_generator.rb', line 55 def setup_directories empty_directory("lib/capistrano") create_file("lib/capistrano/.keep") end |