Class: Ewigkeks::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_javascriptObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/generators/ewigkeks/install/install_generator.rb', line 5

def add_javascript
  ['js', 'js.erb', 'js.coffee'].each do |extension|
    relative_path = 'app/assets/javascripts/application.%s' % extension
    absolute_path = Pathname.new(destination_root).join(relative_path)

    if absolute_path.file?
      append_to_file relative_path do
        "//= require ewigkeks\n"
      end
    end
  end
end

#copy_initializerObject



22
23
24
# File 'lib/generators/ewigkeks/install/install_generator.rb', line 22

def copy_initializer
  template 'initializer.rb', 'config/initializers/ewigkeks.rb'
end

#mount_routesObject



18
19
20
# File 'lib/generators/ewigkeks/install/install_generator.rb', line 18

def mount_routes
  route 'mount Ewigkeks::Engine => Ewigkeks.scope'
end