Class: Rich::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Rich::Generators::InstallGenerator
- Defined in:
- lib/generators/rich/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #copy_initializer ⇒ Object
- #create_migrations ⇒ Object
- #install_editor_styles ⇒ Object
- #install_javascript ⇒ Object
- #setup_route ⇒ Object
Class Method Details
.source_root ⇒ Object
8 9 10 |
# File 'lib/generators/rich/install/install_generator.rb', line 8 def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end |
Instance Method Details
#copy_initializer ⇒ Object
12 13 14 |
# File 'lib/generators/rich/install/install_generator.rb', line 12 def copy_initializer template 'rich.rb.erb', 'config/initializers/rich.rb' end |
#create_migrations ⇒ Object
28 29 30 |
# File 'lib/generators/rich/install/install_generator.rb', line 28 def create_migrations rake "rich:install:migrations" end |
#install_editor_styles ⇒ Object
20 21 22 |
# File 'lib/generators/rich/install/install_generator.rb', line 20 def install_editor_styles copy_file '../../../../../app/assets/stylesheets/rich/editor.css', 'app/assets/stylesheets/rich/editor.css' end |
#install_javascript ⇒ Object
24 25 26 |
# File 'lib/generators/rich/install/install_generator.rb', line 24 def install_javascript template 'rich.js', 'app/assets/javascripts/rich.js' end |
#setup_route ⇒ Object
16 17 18 |
# File 'lib/generators/rich/install/install_generator.rb', line 16 def setup_route route "mount Rich::Engine => '/rich', :as => 'rich'" end |