Class: Bootstrap::Generators::ScaffoldGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/twitter-bootstrap-scaffold.rb

Instance Method Summary collapse

Instance Method Details

#generate_scaffoldObject

——————-# generate_scaffold # ——————-#



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/twitter-bootstrap-scaffold.rb', line 24

def generate_scaffold
  # ディレクトリ作成
  empty_directory "app/assets/images/bootstrap"
  empty_directory "app/assets/javascripts/bootstrap"
  empty_directory "app/assets/stylesheets/bootstrap"

  # img/images
  copy_file( "templates/bootstrap/img/glyphicons-halflings-white.png", "app/assets/images/bootstrap/glyphicons-halflings-white.png" )
  copy_file( "templates/bootstrap/img/glyphicons-halflings.png", "app/assets/images/bootstrap/glyphicons-halflings.png" )

  # js/javascripts
  copy_file( "templates/bootstrap/js/bootstrap.js", "app/assets/javascripts/bootstrap/bootstrap.js" )
  copy_file( "templates/bootstrap/js/bootstrap.min.js", "app/assets/javascripts/bootstrap/bootstrap.min.js" )

  # css/stylesheets
  copy_file( "templates/bootstrap/css/bootstrap-responsive.css", "app/assets/stylesheets/bootstrap/bootstrap-responsive.css" )
  copy_file( "templates/bootstrap/css/bootstrap-responsive.min.css", "app/assets/stylesheets/bootstrap/bootstrap-responsive.min.css" )
  copy_file( "templates/bootstrap/css/bootstrap.css", "app/assets/stylesheets/bootstrap/bootstrap.css" )
  copy_file( "templates/bootstrap/css/bootstrap.min.css", "app/assets/stylesheets/bootstrap/bootstrap.min.css" )
end