Skip to content

Instantly share code, notes, and snippets.

@ErebusBat
Created March 18, 2011 14:07
Show Gist options
  • Save ErebusBat/876122 to your computer and use it in GitHub Desktop.
Save ErebusBat/876122 to your computer and use it in GitHub Desktop.
Section of rails application template that is causing issues.
# For ideas, see: https://github.com/madebydna/rails-templater
# Create GIT repository
git :init
append_file '.gitignore', '.idea/' #RubyMine files
#git :add => '.'
git :commit => '-a -m "New rails from template"'
# gems
gem 'haml', '>= 3.0.25'
gem 'haml-rails', '>= 0.3.4'
gem 'jquery-rails', '>= 0.2.7'
gem 'compass', '>= 0.10.6'
# Compass Config Options
compass_sass_dir = "app/stylesheets"
compass_css_dir = "public/stylesheets/compiled"
compass_command = "compass init rails . --using blueprint/semantic --css-dir=#{compass_css_dir} --sass-dir=#{compass_sass_dir} "
# Run generators/installers
run 'bundle install --local'
# Do special things to get aournd the HTTPS issue
inside('config') do
say_status "info", "Overriding OpenSSL to not verify CA chain for jQuery install.", :yellow
say_status "info", " expect warning about already initialized constant VERIFY_PEER", :yellow
copy_file 'environment.rb', 'env.orig'
gsub_file 'environment.rb', '# Load the rails application', "require 'openssl'\nOpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE"
generate 'jquery:install --ui'
copy_file 'env.orig', 'environment.rb'
end
puts "Beginning Compass setup"
run compass_command
puts "Compass has been setup"
# Setup Haml
remove_file 'app/views/layouts/application.html.erb'
create_file 'app/views/layouts/application.html.haml', <<EOF
!!! 5
%head
%html
= csrf_meta_tag
= stylesheet_link_tag 'compiled/screen.css', :media => 'screen, projection'
= stylesheet_link_tag 'compiled/print.css', :media => 'print'
/[if lt IE 8]
= stylesheet_link_tag 'compiled/ie.css', :media => 'screen, projection'
%body
= yield
= javascript_include_tag :defaults
EOF
initializer 'haml.rb',<<EOF
Haml::Template.options[:format] = :html5
EOF
# Add changes
#git :add => '.'
git :commit => '-a -m "Rails app configured with template."'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment