Class: LessRailsBootstrap::Generators::CustomBootstrapGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/less_rails_bootstrap/custom_bootstrap/custom_bootstrap_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_custom_bootstrapObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/generators/less_rails_bootstrap/custom_bootstrap/custom_bootstrap_generator.rb', line 7

def create_custom_bootstrap
  create_file 'app/assets/stylesheets/custom_bootstrap/custom_bootstrap.less' do
    gem_app_dir = File.expand_path('../../../../../app', __FILE__)
    source_file = File.join(gem_app_dir, 'frameworks', 'twitter', 'bootstrap', 'bootstrap.less')

    lines = File.readlines(source_file)

    lines = change_paths_to_less_files(lines)
    lines = insert_custom_less_files(lines)
    lines = insert_header(lines)

    lines.join
  end

  create_file 'app/assets/stylesheets/custom_bootstrap/variables.less', skip: true do
    "// Use this file to override Twitter Bootstrap variables or define own variables.\n"
  end

  create_file 'app/assets/stylesheets/custom_bootstrap/mixins.less', skip: true do
    "// Use this file to override Twitter Bootstrap mixins or define own mixins.\n"
  end
end