Class: Regulate::Generators::StrapGenerator

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

Overview

Class lifted from Devise. Thanks josevalim!

Instance Method Summary collapse

Instance Method Details

#copy_jsObject

Copy over our JS



27
28
29
# File 'lib/generators/regulate/strap_generator.rb', line 27

def copy_js
  template "public/javascripts/regulate_admin.js", "public/javascripts/regulate_admin.js"
end

#copy_viewsObject

Copy over our view files



15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/regulate/strap_generator.rb', line 15

def copy_views
  case options[:template_engine].to_s
  when "haml"
    verify_haml_existence
    verify_haml_version
    create_and_copy_haml_views
  else
    directory "app/views/regulate", "app/views/regulate"
  end
end

#copy_ymlObject

Copy over the repo config YAML file



32
33
34
# File 'lib/generators/regulate/strap_generator.rb', line 32

def copy_yml
  template "config/regulate.yml", "config/regulate.yml"
end