Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 1.50 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # rails new NAME -OJ -m https://gist.github.com/raw/903515/rails-template.rb
  2.  
  3. remove_file 'README'
  4. remove_file 'public/index.html'
  5. remove_file 'public/images/rails.png'
  6.  
  7. prepend_file 'config/boot.rb' do <<-RB
  8. begin
  9.   require 'yaml'
  10.   YAML::ENGINE.yamler = 'syck'
  11. rescue Exception => e
  12.   puts e.to_s
  13. end
  14.  
  15. RB
  16. end
  17.  
  18. git :init
  19. git :add => "."
  20. git :commit => "-a -m 'initial commit'"
  21.  
  22.  
  23. # JQuery
  24.  
  25. get 'http://html5shiv.googlecode.com/svn/trunk/html5.js', 'public/javascripts/html5.js'
  26.  
  27. gem 'jquery-rails'
  28. run 'sudo bundle'
  29.  
  30. if yes?('Use Jquery UI?')
  31.   generate 'jquery:install --ui'
  32. else
  33.   generate 'jquery:install'
  34. end  
  35.  
  36. git :add => "."
  37. git :commit => "-a -m 'added jquery'"
  38.  
  39.  
  40. # Gems
  41.  
  42. if yes?('Use Compass & HAML?')
  43.   %w(haml compass).map { |g| gem g }
  44.   run 'sudo bundle'
  45.  
  46.   sass_dir  = "app/stylesheets"
  47.   css_dir   = "public/stylesheets"
  48.  
  49.   run "compass init rails . --using blueprint/semantic --css-dir=#{css_dir} --sass-dir=#{sass_dir}"
  50.  
  51.   git :add => "."
  52.   git :commit => "-a -m 'added compass'"
  53. end
  54.  
  55. if yes?('Use Barista for CoffeeScript?')
  56.   %w(json barista).map { |g| gem g }
  57.   run 'sudo bundle'
  58.  
  59.   generate 'barista:install'
  60.  
  61.   git :add => "."
  62.   git :commit => "-a -m 'added barista'"
  63. end
  64.  
  65.  
  66. # MongoID
  67.  
  68. if yes?('Use Mongoid?')
  69.   %w(mongoid bson_ext).map { |g| gem g }
  70.   run 'sudo bundle'
  71.  
  72.   generate 'mongoid:config'
  73.  
  74.   gsub_file 'config/mongoid.yml', /\s*allow_dynamic_fields: true/, ''
  75.   gsub_file 'config/mongoid.yml', /\s*raise_not_found_error: true/, ''
  76.  
  77.   git :add => "."
  78.   git :commit => "-a -m 'added mongoid'"
  79. end