Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 250 lines (224 sloc) 9.967 kb
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 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
gem "rspec-rails", "2.0.0.beta.19", :group => [:test, :development]
gem "cucumber-rails", "0.3.2", :group => [:test, :development]
gem "factory_girl_rails", "1.0", :group => :test
gem "remarkable_activerecord", "4.0.0.alpha4", :group => :test
gem "capybara", "0.3.9", :group => :test
gem "launchy", "0.3.7", :group => :test

gem "haml", "3.0.17"
gem "compass", "0.10.4"

gem "devise", "1.1.1"
gem "friendly_id", "3.1.3"
gem "will_paginate", "3.0.pre2"
gem "attribute_normalizer", "0.2.0"

run "bundle install"

generate "rspec:install"
# $ rails g rspec:install
# create .rspec
# create spec
# create spec/spec_helper.rb
# create autotest
# create autotest/discover.rb

generate "cucumber:install --rspec --capybara"
# $ rails g cucumber:install --rspec --capybara
# create config/cucumber.yml
# create script/cucumber
# chmod script/cucumber
# create features/step_definitions
# create features/step_definitions/web_steps.rb
# create features/support
# create features/support/paths.rb
# create features/support/env.rb
# exist lib/tasks
# create lib/tasks/cucumber.rake
# gsub config/database.yml
# gsub config/database.yml
# force config/database.yml

generate "devise:install"
# $ rails g devise:install
# create config/initializers/devise.rb
# create config/locales/devise.en.yml
#
# ===============================================================================
#
# Some setup you must do manually if you haven't yet:
#
# 1. Setup default url options for your specific environment. Here is an
# example of development environment:
#
# config.action_mailer.default_url_options = { :host => 'localhost:3000' }
#
# This is a required Rails configuration. In production it must be the
# actual host of your application
#
# 2. Ensure you have defined root_url to *something* in your config/routes.rb.
# For example:
#
# root :to => "home#index"
#
# 3. Ensure you have flash messages in app/views/layouts/application.html.erb.
# For example:
#
# <p class="notice"><%= notice %></p>
# <p class="alert"><%= alert %></p>
#
# ===============================================================================

generate "devise:views"
# $ rails g devise:views
# create app/views/devise
# create app/views/devise/confirmations/new.html.erb
# create app/views/devise/mailer/confirmation_instructions.html.erb
# create app/views/devise/mailer/reset_password_instructions.html.erb
# create app/views/devise/mailer/unlock_instructions.html.erb
# create app/views/devise/passwords/edit.html.erb
# create app/views/devise/passwords/new.html.erb
# create app/views/devise/registrations/edit.html.erb
# create app/views/devise/registrations/new.html.erb
# create app/views/devise/sessions/new.html.erb
# create app/views/devise/shared/_links.erb
# create app/views/devise/unlocks/new.html.erb

gsub_file "config/environments/development.rb", /^end$/, "\n config.action_mailer.default_url_options = { :host => 'localhost:3000' }\nend"
gsub_file "config/environments/test.rb", /^end$/, "\n config.action_mailer.default_url_options = { :host => 'localhost:3000' }\nend"
gsub_file "config/environments/production.rb", /^end$/, "\n config.action_mailer.default_url_options = { :host => 'site.com' }\nend"

generate "controller home index"
# $ rails g controller home index
# create app/controllers/home_controller.rb
# route get "home/index"
# invoke erb
# create app/views/home
# create app/views/home/index.html.erb
# invoke rspec
# create spec/controllers/home_controller_spec.rb
# create spec/views/home
# create spec/views/home/index.html.erb_spec.rb
# invoke helper
# create app/helpers/home_helper.rb
# invoke rspec
# create spec/helpers/home_helper_spec.rb

gsub_file "config/routes.rb", ' get "home/index"', ""
route "root :to => 'home#index'"
run "rm spec/controllers/home_controller_spec.rb"
run "rm -rf spec/views/home"
run "rm app/helpers/home_helper.rb"
run "rm spec/helpers/home_helper_spec.rb"

# $ rails g devise User
# invoke active_record
# create app/models/user.rb
# invoke rspec
# create spec/models/user_spec.rb
# create db/migrate/20100816203044_devise_create_users.rb
# inject app/models/user.rb
# route devise_for :users

get "http://gist.github.com/raw/527881/7db87caca84e557a6aead74b1608d0a2b999e988/user.rb", "app/models/user.rb"
get "http://gist.github.com/raw/527881/983fa358d8b2b78fbe70595722666e9ce1b9615a/devise_create_users.rb", "db/migrate/#{Time.now.strftime("%Y%m%d%H%M%S")}_devise_create_users.rb"
route "devise_for :users"
get "http://gist.github.com/raw/527881/1949bd809284f87f9f3d4c2f0f60132e047e01e3/devise.pt-BR.yml", "config/locales/devise.pt-BR.yml"

get "http://gist.github.com/raw/527881/c9268dfa577a4f25f5bba94a12cb29e72280f9fb/pt-BR.yml", "config/locales/pt-BR.yml"
gsub_file "config/application.rb", " # config.i18n.default_locale = :de", " config.i18n.default_locale = 'pt-BR'"

gsub_file "config/environments/development.rb", /^end$/, <<-END

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:user_name => "username@gmail.com",
:password => "your_password",
:authentication => "plain",
:enable_starttls_auto => true
}

end

END

run "rm README public/index.html public/images/rails.png doc/README_FOR_APP"
file "README.md", "README"

get "http://code.jquery.com/jquery-1.4.2.min.js", "public/javascripts/jquery-1.4.2.min.js"
get "http://github.com/rails/jquery-ujs/raw/master/src/rails.js", "public/javascripts/rails.js"

rake "db:create:all"
rake "db:migrate"
rake "db:test:prepare"

file ".gitignore", <<-END
.bundle
db/*.sqlite3
log/*.log
tmp/**/*
vendor/rails/*
public/system/*
.DS_Store
db/schema.rb
public/cache
public/system
doc/*
cache
END
git :init
git :add => "."
git :commit => "-am 'Primeiro commit'"

# $ compass init rails .
# Compass recommends that you keep your stylesheets in app/stylesheets
# instead of the Sass default location of public/stylesheets/sass.
# Is this OK? (Y/n) Y
#
# Compass recommends that you keep your compiled css in public/stylesheets/compiled/
# instead the Sass default of public/stylesheets/.
# However, if you're exclusively using Sass, then public/stylesheets/ is recommended.
# Emit compiled stylesheets to public/stylesheets/compiled/? (Y/n) n
# directory ./app/stylesheets/
# exists ./public/stylesheets
# exists ./config
# create ./config/compass.rb
# exists ./config/initializers
# create ./config/initializers/compass.rb
# convert screen.sass
# create ./app/stylesheets/screen.scss
# convert print.sass
# create ./app/stylesheets/print.scss
# convert ie.sass
# create ./app/stylesheets/ie.scss
#
# Congratulations! Your rails project has been configured to use Compass.
# Just one more thing left to do: Register the compass gem.
#
# In Rails 2.2 & 2.3, add the following to your evironment.rb:
#
# config.gem "compass", :version => ">= 0.10.2"
#
# In Rails 3, add the following to your Gemfile:
#
# gem "compass", ">= 0.10.2"
#
# Then, make sure you restart your server.
#
# Sass will automatically compile your stylesheets during the next
# page request and keep them up to date when they change.
#
# Next add these lines to the head of your layouts:
#
# %head
# = stylesheet_link_tag 'screen.css', :media => 'screen, projection'
# = stylesheet_link_tag 'print.css', :media => 'print'
# /[if IE]
# = stylesheet_link_tag 'ie.css', :media => 'screen, projection'
#
# (You are using haml, aren't you?)

get "http://gist.github.com/raw/527881/033d9ee44405ce178a50eb2083c805ba11db6264/_960.scss", "app/stylesheets/_960.scss"
get "http://gist.github.com/raw/527881/8b3db224d76e87052235488a78747c3fa46e7883/application.scss", "app/stylesheets/application.scss"
run "rm app/views/layouts/application.html.erb"
get "http://gist.github.com/raw/527881/80a7dc3fc7bf24b7d777586f2cd6a5ab9d2af0c5/application.html.haml", "app/views/layouts/application.html.haml"

gsub_file "config/routes.rb", /^end$/, <<-END

devise_scope :user do
get "criar-conta", :to => "devise/registrations#new", :as => :signup
post "criar-conta", :to => "devise/registrations#create", :as => :signup
get "login", :to => "devise/sessions#new", :as => :login
post "login", :to => "devise/sessions#create", :as => :login
get "sair", :to => "devise/sessions#destroy", :as => :logout
get "recuperar-senha", :to => "devise/passwords#new", :as => :recover_password
post "recuperar-senha", :to => "devise/passwords#create", :as => :recover_password
get "s/:reset_password_token", :to => 'devise/passwords#edit', :as => :reset_password
put "alterar-senha", :to => 'devise/passwords#update', :as => :change_password
get "enviar-confirmacao", :to => "devise/confirmations#new", :as => :send_confirmation
post "enviar-confirmacao", :to => "devise/confirmations#create", :as => :send_confirmation
get "c/:confirmation_token", :to => "devise/confirmations#show", :as => :confirmation
get "editar-dados", :to => "devise/registrations#edit", :as => :account
put "editar-dados", :to => "devise/registrations#update", :as => :account
delete "cancelar-conta", :to => "devise/registrations#destroy", :as => :cancel_account
end

end
END
Something went wrong with that request. Please try again.