Class: Rich::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/rich/install/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



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_initializerObject



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_migrationsObject



28
29
30
# File 'lib/generators/rich/install/install_generator.rb', line 28

def create_migrations
  rake "rich:install:migrations"
end

#install_editor_stylesObject



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_javascriptObject



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_routeObject



16
17
18
# File 'lib/generators/rich/install/install_generator.rb', line 16

def setup_route
  route "mount Rich::Engine => '/rich', :as => 'rich'"
end