public
Last active — forked from elomar/template.rb

  • Download Gist
template.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
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'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.