Class: Html5LayoutGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Html5LayoutGenerator
- Defined in:
- lib/generators/html5_layout/html5_layout_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#generate_layout ⇒ Object
class_option :haml, :type => :boolean, :desc => “Include the SASS version for CSS”.
Class Method Details
.source_root ⇒ Object
4 5 6 |
# File 'lib/generators/html5_layout/html5_layout_generator.rb', line 4 def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end |
Instance Method Details
#generate_layout ⇒ Object
class_option :haml, :type => :boolean, :desc => “Include the SASS version for CSS”
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/generators/html5_layout/html5_layout_generator.rb', line 13 def generate_layout if .sass? directory 'app' gem 'compass', '>=0.10.5' gem 'compass-960-plugin', '>=0.10.0' directory 'config' else copy_file "stylesheet.css", "public/stylesheets/#{file_name}.css" if .stylesheet? copy_file "handheld.css", "public/stylesheets/handheld.css" if .stylesheet? end copy_file "modernizr-1.5.min.js", "public/javascripts/modernizr-1.5.min.js" copy_file "jquery-1.4.2.min.js", "public/javascripts/jquery-1.4.2.min.js" copy_file "dd_belatedpng.js", "public/javascripts/dd_belatedpng.js" template "layout.html.erb", "app/views/layouts/#{file_name}.html.erb" copy_file 'layout_helper.rb', 'app/helpers/layout_helper.rb' end |