Class: Bootstrap::CustomizeGenerator

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

Instance Method Summary collapse

Instance Method Details

#customize_css_componentsObject



16
17
18
19
20
21
22
# File 'lib/generators/bootstrap/customize_generator.rb', line 16

def customize_css_components
  if options.css_components?
    append_file "app/assets/stylesheets/bootstrap-custom.css.scss" do
      File.read File.expand_path("../../../../app/assets/stylesheets/twitter/bootstrap.css.scss", __FILE__)
    end
  end
end

#customize_default_variablesObject

Copy all needed stylesheets in the asset directory of the application



12
13
14
# File 'lib/generators/bootstrap/customize_generator.rb', line 12

def customize_default_variables
  template "bootstrap-custom.css.scss", "app/assets/stylesheets/bootstrap-custom.css.scss"
end

#customize_js_componentsObject



24
25
26
27
28
29
30
31
# File 'lib/generators/bootstrap/customize_generator.rb', line 24

def customize_js_components
  if options.js_components?
    template "bootstrap-custom.js", "app/assets/javascripts/bootstrap-custom.js"
    append_file "app/assets/javascripts/bootstrap-custom.js" do
      File.read File.expand_path("../../../../app/assets/javascripts/twitter/bootstrap.js", __FILE__)
    end
  end
end

#show_usageObject



33
34
35
# File 'lib/generators/bootstrap/customize_generator.rb', line 33

def show_usage
  readme "USAGE" if behavior == :invoke
end