Class: Mercury::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Mercury::Generators::InstallGenerator
- Defined in:
- lib/generators/mercury/install/install_generator.rb
Instance Method Summary collapse
- #add_routes ⇒ Object
- #copy_authentication_overrides ⇒ Object
- #copy_config ⇒ Object
- #copy_layout_and_css_overrides ⇒ Object
- #copy_models ⇒ Object
- #display_readme ⇒ Object
Instance Method Details
#add_routes ⇒ Object
18 19 20 |
# File 'lib/generators/mercury/install/install_generator.rb', line 18 def add_routes route %Q{Mercury::Engine.routes} end |
#copy_authentication_overrides ⇒ Object
37 38 39 40 41 |
# File 'lib/generators/mercury/install/install_generator.rb', line 37 def copy_authentication_overrides if [:full] || yes?("Install the authentication file so you can restrict access to editing? [yN]") copy_file 'lib/mercury/authentication.rb' end end |
#copy_config ⇒ Object
14 15 16 |
# File 'lib/generators/mercury/install/install_generator.rb', line 14 def copy_config copy_file 'vendor/assets/javascripts/mercury.js', 'app/assets/javascripts/mercury.js' end |
#copy_layout_and_css_overrides ⇒ Object
30 31 32 33 34 35 |
# File 'lib/generators/mercury/install/install_generator.rb', line 30 def copy_layout_and_css_overrides if [:full] || yes?("Install the layout and CSS overrides files? [yN]") copy_file 'app/views/layouts/mercury.html.erb', 'app/views/layouts/mercury.html.erb' copy_file 'vendor/assets/stylesheets/mercury_overrides.css', 'app/assets/stylesheets/mercury_overrides.css' end end |
#copy_models ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/generators/mercury/install/install_generator.rb', line 22 def copy_models if [:orm] == 'mongoid' copy_file 'lib/generators/mercury/install/templates/mongoid_paperclip_image.rb', 'app/models/mercury/image.rb' else copy_file 'app/models/mercury/image.rb' if [:full] end end |
#display_readme ⇒ Object
43 44 45 |
# File 'lib/generators/mercury/install/install_generator.rb', line 43 def display_readme readme 'POST_INSTALL' if behavior == :invoke end |