Browse files

Update remaning 1.8 hash syntax.

  • Loading branch information...
1 parent 3d9dea3 commit aea82d0b03a8aa150be8f692bf880d140e477d2e @lucasmazza lucasmazza committed Feb 25, 2014
Showing with 68 additions and 68 deletions.
  1. +2 −2 Gemfile
  2. +1 −1 Rakefile
  3. +2 −2 app/views/devise/confirmations/new.html.erb
  4. +1 −1 app/views/devise/mailer/confirmation_instructions.html.erb
  5. +1 −1 app/views/devise/mailer/reset_password_instructions.html.erb
  6. +1 −1 app/views/devise/mailer/unlock_instructions.html.erb
  7. +3 −3 app/views/devise/passwords/edit.html.erb
  8. +2 −2 app/views/devise/passwords/new.html.erb
  9. +6 −6 app/views/devise/registrations/edit.html.erb
  10. +4 −4 app/views/devise/registrations/new.html.erb
  11. +3 −3 app/views/devise/sessions/new.html.erb
  12. +2 −2 app/views/devise/unlocks/new.html.erb
  13. +3 −3 gemfiles/Gemfile.rails-3.2-stable
  14. +3 −3 gemfiles/Gemfile.rails-4.0-stable
  15. +3 −3 gemfiles/Gemfile.rails-head
  16. +2 −2 lib/generators/templates/README
  17. +1 −1 lib/generators/templates/markerb/confirmation_instructions.markerb
  18. +1 −1 lib/generators/templates/markerb/reset_password_instructions.markerb
  19. +1 −1 lib/generators/templates/markerb/unlock_instructions.markerb
  20. +2 −2 lib/generators/templates/simple_form_for/confirmations/new.html.erb
  21. +4 −4 lib/generators/templates/simple_form_for/passwords/edit.html.erb
  22. +2 −2 lib/generators/templates/simple_form_for/passwords/new.html.erb
  23. +6 −6 lib/generators/templates/simple_form_for/registrations/edit.html.erb
  24. +4 −4 lib/generators/templates/simple_form_for/registrations/new.html.erb
  25. +4 −4 lib/generators/templates/simple_form_for/sessions/new.html.erb
  26. +2 −2 lib/generators/templates/simple_form_for/unlocks/new.html.erb
  27. +1 −1 test/rails_app/app/views/admins/sessions/new.html.erb
  28. +1 −1 test/rails_app/app/views/layouts/application.html.erb
View
4 Gemfile
@@ -10,8 +10,8 @@ gem "rdoc"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid", "~> 1.0.1"
- gem "webrat", "0.7.3", :require => false
- gem "mocha", "~> 0.13.1", :require => false
+ gem "webrat", "0.7.3", require: false
+ gem "mocha", "~> 0.13.1", require: false
end
platforms :jruby do
View
2 Rakefile
@@ -4,7 +4,7 @@ require 'rake/testtask'
require 'rdoc/task'
desc 'Default: run tests for all ORMs.'
-task :default => :test
+task default: :test
desc 'Run Devise tests for all ORMs.'
task :pre_commit do
View
4 app/views/devise/confirmations/new.html.erb
@@ -1,10 +1,10 @@
<h2>Resend confirmation instructions</h2>
-<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
+<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
- <%= f.email_field :email, :autofocus => true %></div>
+ <%= f.email_field :email, autofocus: true %></div>
<div><%= f.submit "Resend confirmation instructions" %></div>
<% end %>
View
2 app/views/devise/mailer/confirmation_instructions.html.erb
@@ -2,4 +2,4 @@
<p>You can confirm your account email through the link below:</p>
-<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %></p>
+<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
View
2 app/views/devise/mailer/reset_password_instructions.html.erb
@@ -2,7 +2,7 @@
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
-<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) %></p>
+<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>
View
2 app/views/devise/mailer/unlock_instructions.html.erb
@@ -4,4 +4,4 @@
<p>Click the link below to unlock your account:</p>
-<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token) %></p>
+<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
View
6 app/views/devise/passwords/edit.html.erb
@@ -1,14 +1,14 @@
<h2>Change your password</h2>
-<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
+<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= devise_error_messages! %>
<%= f.hidden_field :reset_password_token %>
<div><%= f.label :password, "New password" %><br />
- <%= f.password_field :password, :autofocus => true, :autocomplete => "off" %></div>
+ <%= f.password_field :password, autofocus: true, autocomplete: "off" %></div>
<div><%= f.label :password_confirmation, "Confirm new password" %><br />
- <%= f.password_field :password_confirmation, :autocomplete => "off" %></div>
+ <%= f.password_field :password_confirmation, autocomplete: "off" %></div>
<div><%= f.submit "Change my password" %></div>
<% end %>
View
4 app/views/devise/passwords/new.html.erb
@@ -1,10 +1,10 @@
<h2>Forgot your password?</h2>
-<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
+<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
- <%= f.email_field :email, :autofocus => true %></div>
+ <%= f.email_field :email, autofocus: true %></div>
<div><%= f.submit "Send me reset password instructions" %></div>
<% end %>
View
12 app/views/devise/registrations/edit.html.erb
@@ -1,29 +1,29 @@
<h2>Edit <%= resource_name.to_s.humanize %></h2>
-<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
+<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
- <%= f.email_field :email, :autofocus => true %></div>
+ <%= f.email_field :email, autofocus: true %></div>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
<% end %>
<div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
- <%= f.password_field :password, :autocomplete => "off" %></div>
+ <%= f.password_field :password, autocomplete: "off" %></div>
<div><%= f.label :password_confirmation %><br />
- <%= f.password_field :password_confirmation, :autocomplete => "off" %></div>
+ <%= f.password_field :password_confirmation, autocomplete: "off" %></div>
<div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
- <%= f.password_field :current_password, :autocomplete => "off" %></div>
+ <%= f.password_field :current_password, autocomplete: "off" %></div>
<div><%= f.submit "Update" %></div>
<% end %>
<h3>Cancel my account</h3>
-<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %></p>
+<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
<%= link_to "Back", :back %>
View
8 app/views/devise/registrations/new.html.erb
@@ -1,16 +1,16 @@
<h2>Sign up</h2>
-<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
+<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
- <%= f.email_field :email, :autofocus => true %></div>
+ <%= f.email_field :email, autofocus: true %></div>
<div><%= f.label :password %><br />
- <%= f.password_field :password, :autocomplete => "off" %></div>
+ <%= f.password_field :password, autocomplete: "off" %></div>
<div><%= f.label :password_confirmation %><br />
- <%= f.password_field :password_confirmation, :autocomplete => "off" %></div>
+ <%= f.password_field :password_confirmation, autocomplete: "off" %></div>
<div><%= f.submit "Sign up" %></div>
<% end %>
View
6 app/views/devise/sessions/new.html.erb
@@ -1,11 +1,11 @@
<h2>Sign in</h2>
-<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
+<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div><%= f.label :email %><br />
- <%= f.email_field :email, :autofocus => true %></div>
+ <%= f.email_field :email, autofocus: true %></div>
<div><%= f.label :password %><br />
- <%= f.password_field :password, :autocomplete => "off" %></div>
+ <%= f.password_field :password, autocomplete: "off" %></div>
<% if devise_mapping.rememberable? -%>
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
View
4 app/views/devise/unlocks/new.html.erb
@@ -1,10 +1,10 @@
<h2>Resend unlock instructions</h2>
-<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
+<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
- <%= f.email_field :email, :autofocus => true %></div>
+ <%= f.email_field :email, autofocus: true %></div>
<div><%= f.submit "Resend unlock instructions" %></div>
<% end %>
View
6 gemfiles/Gemfile.rails-3.2-stable
@@ -1,6 +1,6 @@
source "https://rubygems.org"
-gemspec :path => '..'
+gemspec path: '..'
gem "rails", github: 'rails/rails', branch: '3-2-stable'
gem "omniauth", "~> 1.0.0"
@@ -10,8 +10,8 @@ gem "rdoc"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid", "~> 1.0.1"
- gem "webrat", "0.7.3", :require => false
- gem "mocha", "~> 0.13.1", :require => false
+ gem "webrat", "0.7.3", require: false
+ gem "mocha", "~> 0.13.1", require: false
end
platforms :jruby do
View
6 gemfiles/Gemfile.rails-4.0-stable
@@ -1,6 +1,6 @@
source "https://rubygems.org"
-gemspec :path => '..'
+gemspec path: '..'
gem "rails", github: 'rails/rails', branch: '4-0-stable'
gem "omniauth", "~> 1.0.0"
@@ -10,8 +10,8 @@ gem "rdoc"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid", "~> 1.0.1"
- gem "webrat", "0.7.3", :require => false
- gem "mocha", "~> 0.13.1", :require => false
+ gem "webrat", "0.7.3", require: false
+ gem "mocha", "~> 0.13.1", require: false
end
platforms :jruby do
View
6 gemfiles/Gemfile.rails-head
@@ -1,6 +1,6 @@
source "https://rubygems.org"
-gemspec :path => '..'
+gemspec path: '..'
gem "rails", github: 'rails/rails'
gem "omniauth", "~> 1.0.0"
@@ -10,8 +10,8 @@ gem "rdoc"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid", "~> 1.0.1"
- gem "webrat", "0.7.3", :require => false
- gem "mocha", "~> 0.14", :require => false
+ gem "webrat", "0.7.3", require: false
+ gem "mocha", "~> 0.14", require: false
end
platforms :jruby do
View
4 lib/generators/templates/README
@@ -6,14 +6,14 @@ Some setup you must do manually if you haven't yet:
is an example of default_url_options appropriate for a development environment
in config/environments/development.rb:
- config.action_mailer.default_url_options = { :host => 'localhost:3000' }
+ config.action_mailer.default_url_options = { host: 'localhost:3000' }
In production, :host should be set to 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"
+ root to: "home#index"
3. Ensure you have flash messages in app/views/layouts/application.html.erb.
For example:
View
2 lib/generators/templates/markerb/confirmation_instructions.markerb
@@ -2,4 +2,4 @@ Welcome <%= @email %>!
You can confirm your account through the link below:
-<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %>
+<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>
View
2 lib/generators/templates/markerb/reset_password_instructions.markerb
@@ -2,7 +2,7 @@ Hello <%= @resource.email %>!
Someone has requested a link to change your password, and you can do this through the link below.
-<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) %>
+<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>
If you didn't request this, please ignore this email.
Your password won't change until you access the link above and create a new one.
View
2 lib/generators/templates/markerb/unlock_instructions.markerb
@@ -4,4 +4,4 @@ Your account has been locked due to an excessive number of unsuccessful sign in
Click the link below to unlock your account:
-<%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token) %>
+<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>
View
4 lib/generators/templates/simple_form_for/confirmations/new.html.erb
@@ -1,11 +1,11 @@
<h2>Resend confirmation instructions</h2>
-<%= simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
+<%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<%= f.error_notification %>
<%= f.full_error :confirmation_token %>
<div class="form-inputs">
- <%= f.input :email, :required => true, :autofocus => true %>
+ <%= f.input :email, required: true, autofocus: true %>
</div>
<div class="form-actions">
View
8 lib/generators/templates/simple_form_for/passwords/edit.html.erb
@@ -1,14 +1,14 @@
<h2>Change your password</h2>
-<%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
+<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= f.error_notification %>
- <%= f.input :reset_password_token, :as => :hidden %>
+ <%= f.input :reset_password_token, as: :hidden %>
<%= f.full_error :reset_password_token %>
<div class="form-inputs">
- <%= f.input :password, :label => "New password", :required => true, :autofocus => true %>
- <%= f.input :password_confirmation, :label => "Confirm your new password", :required => true %>
+ <%= f.input :password, label: "New password", required: true, autofocus: true %>
+ <%= f.input :password_confirmation, label: "Confirm your new password", required: true %>
</div>
<div class="form-actions">
View
4 lib/generators/templates/simple_form_for/passwords/new.html.erb
@@ -1,10 +1,10 @@
<h2>Forgot your password?</h2>
-<%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
+<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
- <%= f.input :email, :required => true, :autofocus => true %>
+ <%= f.input :email, required: true, autofocus: true %>
</div>
<div class="form-actions">
View
12 lib/generators/templates/simple_form_for/registrations/edit.html.erb
@@ -1,18 +1,18 @@
<h2>Edit <%= resource_name.to_s.humanize %></h2>
-<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
+<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
- <%= f.input :email, :required => true, :autofocus => true %>
+ <%= f.input :email, required: true, autofocus: true %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
<% end %>
- <%= f.input :password, :autocomplete => "off", :hint => "leave it blank if you don't want to change it", :required => false %>
- <%= f.input :password_confirmation, :required => false %>
- <%= f.input :current_password, :hint => "we need your current password to confirm your changes", :required => true %>
+ <%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %>
+ <%= f.input :password_confirmation, required: false %>
+ <%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %>
</div>
<div class="form-actions">
@@ -22,6 +22,6 @@
<h3>Cancel my account</h3>
-<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %></p>
+<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
<%= link_to "Back", :back %>
View
8 lib/generators/templates/simple_form_for/registrations/new.html.erb
@@ -1,12 +1,12 @@
<h2>Sign up</h2>
-<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
+<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
- <%= f.input :email, :required => true, :autofocus => true %>
- <%= f.input :password, :required => true %>
- <%= f.input :password_confirmation, :required => true %>
+ <%= f.input :email, required: true, autofocus: true %>
+ <%= f.input :password, required: true %>
+ <%= f.input :password_confirmation, required: true %>
</div>
<div class="form-actions">
View
8 lib/generators/templates/simple_form_for/sessions/new.html.erb
@@ -1,10 +1,10 @@
<h2>Sign in</h2>
-<%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
+<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs">
- <%= f.input :email, :required => false, :autofocus => true %>
- <%= f.input :password, :required => false %>
- <%= f.input :remember_me, :as => :boolean if devise_mapping.rememberable? %>
+ <%= f.input :email, required: false, autofocus: true %>
+ <%= f.input :password, required: false %>
+ <%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
</div>
<div class="form-actions">
View
4 lib/generators/templates/simple_form_for/unlocks/new.html.erb
@@ -1,11 +1,11 @@
<h2>Resend unlock instructions</h2>
-<%= simple_form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
+<%= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
<%= f.error_notification %>
<%= f.full_error :unlock_token %>
<div class="form-inputs">
- <%= f.input :email, :required => true, :autofocus => true %>
+ <%= f.input :email, required: true, autofocus: true %>
</div>
<div class="form-actions">
View
2 test/rails_app/app/views/admins/sessions/new.html.erb
@@ -1,2 +1,2 @@
Welcome to "sessions/new" view!
-<%= render :file => "devise/sessions/new" %>
+<%= render file: "devise/sessions/new" %>
View
2 test/rails_app/app/views/layouts/application.html.erb
@@ -7,7 +7,7 @@
<body>
<div id="container">
<%- flash.each do |name, msg| -%>
- <%= content_tag :div, msg, :id => "flash_#{name}" %>
+ <%= content_tag :div, msg, id: "flash_#{name}" %>
<%- end -%>
<% if user_signed_in? -%>

0 comments on commit aea82d0

Please sign in to comment.