Skip to content

@rduarte /template.rb forked from elomar/template.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
run 'gem sources -a http://gemcutter.org'
git :init
file '.gitignore', <<TXT
log/*.log
tmp/**/*
db/*.sqlite3
.DT_Store
TXT
file 'config/locales/pt-BR.yml', open('http://github.com/svenfuchs/rails-i18n/raw/master/rails/locale/pt-BR.yml').read
run "rm public/index.html"
git :add => '.', :commit => '-m "Initial commit"'
with_options :env => 'test' do |test|
test.gem 'rspec', :lib => false
test.gem 'rspec-rails', :lib => false
test.gem 'cucumber'
test.gem 'webrat'
test.rake 'gems:install'
end
generate :rspec
generate :cucumber
git :add => '.', :commit => '-m "Rspec e cucumber"'
gem :haml
in_root { run 'haml --rails .' }
git :add => '.', :commit => '-m Haml'
gem 'warden'
gem 'devise'
rake 'gems:install'
generate :devise_install
generate :devise_views
generate :devise, "User"
git :add => '.', :commit => '-m Devise'
git :clone => 'git://github.com/thoughtbot/hoptoad_notifier.git vendor/plugins/hoptoad_notifier'
run 'rm -rf vendor/plugins/hoptoad_notifier/.git'
initializer 'hoptoad.rb', <<TXT
HoptoadNotifier.configure do |config|
config.api_key = 'YOUR_API_KEY'
end
TXT
rake 'hoptoad:test'
git :add => '.', :commit => '-m Hoptoad'
with_options :env => 'development' do |dev|
dev.gem 'inherited_resources'
dev.gem 'formtastic'
dev.gem 'will_paginate'
dev.gem 'machinist'
dev.gem 'grimen-dry_scaffold', :source => 'http://gems.github.com', :lib => false
dev.rake 'gems:install'
end
generate :formtastic
append_file 'Rakefile', <<TXT
begin
require 'dry_scaffold/tasks'
rescue MissingSourceFile
end
TXT
rake 'dry_scaffold:config:generate'
file 'config/scaffold.yml', <<TXT
---
dry_scaffold:
args:
actions: index,show,new,edit,create,update,destroy
formats: html,json
options:
formtastic: true
resourceful: true
pagination: true
layout: false
views: true
helpers: true
tests: true
controller_tests: true
test_unit: false
shoulda: false
rspec: true
fixtures: false
fgirl: false
machinist: true
object_daddy: false
dry_model:
options:
migration: true
timestamps: true
tests: true
test_unit: false
shoulda: false
rspec: true
fixtures: false
fgirl: false
machinist: true
object_daddy: false
TXT
git :add => '.', :commit => '-m dry_scaffold'
initializer 'patch.rb', <<TXT
module ActiveSupport
class MessageVerifier
def secure_compare(a, b)
if a.respond_to?(:bytesize)
# > 1.8.6 friendly version
if a.bytesize == b.bytesize
result = 0
j = b.each_byte
a.each_byte { |i| result |= i ^ j.next }
result == 0
else
false
end
else
# <= 1.8.6 friendly version
if a.size == b.size
result = 0
for i in 0..(a.length - 1)
result |= a[i] ^ b[i]
end
result == 0
else
false
end
end
end
end
end
TXT
git :add => '.', :commit => '-m "Patch pra 1.9"'
gem 'heroku'
run "heroku create #{ask('app name?')}"
file '.gems', <<TXT
haml
will_paginate
formtastic
inherited_resources
devise
warden
TXT
git :add => '.', :commit => '-m "Heroku"'
git :push => 'heroku master'
rake 'db:migrate'
run 'heroku rake db:migrate'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.