Class: PixelatorGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/pixelator/pixelator_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_initializer_fileObject



4
5
6
# File 'lib/generators/pixelator/pixelator_generator.rb', line 4

def copy_initializer_file
  copy_file "pixelator.rb", "config/initializers/pixelator.rb"
end

#copy_pixel_yamlObject



8
9
10
# File 'lib/generators/pixelator/pixelator_generator.rb', line 8

def copy_pixel_yaml
  copy_file "pixels.yml", "config/pixels.yml"
end

#insert_require_pixelator_coreObject



12
13
14
15
# File 'lib/generators/pixelator/pixelator_generator.rb', line 12

def insert_require_pixelator_core
  inject_into_file 'app/assets/javascripts/application.js', "//= require 'pixelator_core'\n",
                   before: "//= require_tree ."
end