Skip to content

Instantly share code, notes, and snippets.

@Arwid
Forked from quinn/all_the_toys.rb
Created May 6, 2011 01:35
Show Gist options
  • Save Arwid/958307 to your computer and use it in GitHub Desktop.
Save Arwid/958307 to your computer and use it in GitHub Desktop.
all the fun stuff i use in my default stack!
# gems
gem 'resque'
# the data
gem 'devise'
gem 'carrierwave'
gem 'fog'
gem 'rmagick'
# controllers and views
gem 'inherited_resources'
gem 'haml-rails'
# javascript and css
gem 'compass'
gem 'barista'
gem 'jammit'
gem 'closure-compiler'
# tests
gem 'rspec-rails'
gem 'cucumber-rails'
gem 'factory_girl', :git => 'git://github.com/thoughtbot/factory_girl.git', :ref => '9fb8a3b'
gem 'capybara', :group => :test
gem 'autotest-rails', :group => :test
gem 'database_cleaner', :group => :test
gem 'launchy', :group => :test
# install gems
run "bundle install"
# generate stuff
generate :"barista:install"
generate :"cucumber:install", "--capybara --rspec"
generate :"devise:install"
generate :"rspec:install"
# generate compass config
run "bundle exec compass init rails . \
--using blueprint/semantic \
-x sass \
--sass-dir app/stylesheets \
--css-dir public/stylesheets/compiled"
# generate jammit config
file "config/assets.yml", <<-CONFIG
package_assets: always
embed_assets: on
compress_assets: off
gzip_assets: off
template_function: _.template # (defaults to the built-in micro-templating)
package_path: packages # (defaults to assets)
javascript_compressor: closure # (yui, closure)
compressor_options:
compilation_level: ADVANCED_OPTIMIZATIONS
javascripts:
compiled:
- public/javascripts/compiled/*.js
- app/views/*.jst
vendor:
- public/javascripts/vendor/*.js
# workspace:
# - public/javascripts/vendor/*.js
# - public/javascripts/application.js
# - public/javascripts/lib/bindable.js
# - public/javascripts/lib/set.js
# - public/javascripts/lib/*.js
# - public/javascripts/**/*.js
# - app/views/jst/workspace/*.jst
CONFIG
initializer "barista_config.rb", <<-CONFIG
Barista.configure do |c|
c.root = Rails.root.join("app", "coffeescripts")
c.output_root = Rails.root.join("public", "javascripts", "compiled")
c.verbose!
end
CONFIG
initializer "debugger.rb", <<-CONFIG
if defined? Debugger
Debugger.settings[:autoeval] = true
end
CONFIG
# templates
file "app/views/layouts/application.html.haml", <<-HAML
!!!
%html
%head
%title New Rails App
= 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'
= csrf_meta_tag
%meta{:name => "session-key", :content => Rails.application.config.session_options[:key] }
%meta{:name => "session-data", :content => u(cookies[Rails.application.config.session_options[:key]])}
%body
#container
#flash-messages
-if notice
.success= notice
-if alert
.error= alert
= yield
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
= include_javascripts :vendor, :compiled
HAML
run "mkdir public/javascripts/vendor"
file "public/javascripts/vendor/rails.js", `curl https://github.com/rails/jquery-ujs/raw/master/src/rails.js`
file "public/javascripts/vendor/underscore.js", `curl http://documentcloud.github.com/underscore/underscore.js`
# remove bs
run "rm public/index.html"
run "rm public/javascripts/application.js"
run "rm app/views/layouts/application.html.erb"
# git stuff
git :init
run %(echo "config/database.yml" >> .gitignore)
run %(echo "public/stylesheets/compiled/*" >> .gitignore)
run %(echo "public/javascripts/compiled/*" >> .gitignore)
run %(echo ".DS_Store" >> .gitignore)
run %(echo "public/uploads/*" >> .gitignore)
git :add => "."
git :commit => "-a -m 'Initial commit'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment