Skip to content
Browse files

Merge pull request #14210 from tjschuck/bcrypt_gem_rename_4-0-stable

Bump version of bcrypt gem in 4-0-stable
  • Loading branch information...
2 parents d91d946 + 085372e commit 772afefab128976718ae69d597400812eedcf010 @carlosantoniodasilva carlosantoniodasilva committed Feb 26, 2014
View
6 Gemfile
@@ -4,11 +4,15 @@ gemspec
gem 'mocha', '~> 0.13.0', require: false
gem 'rack-cache', '~> 1.2'
-gem 'bcrypt-ruby', '~> 3.1.2'
gem 'jquery-rails', '~> 2.2.0'
gem 'turbolinks'
gem 'arel', github: 'rails/arel', branch: '4-0-stable'
+# require: false so bcrypt is loaded only when has_secure_password is used.
+# This is to avoid ActiveModel (and by extension the entire framework)
+# being dependent on a binary library.
+gem 'bcrypt', '~> 3.1.7', require: false
+
# This needs to be with require false to avoid
# it being automatically loaded by sprockets
gem 'uglifier', '>= 1.3.0', require: false
View
8 activemodel/lib/active_model/secure_password.rb
@@ -18,9 +18,9 @@ module ClassMethods
# value to the password_confirmation attribute and the the validation
# will not be triggered.
#
- # You need to add bcrypt-ruby (~> 3.1.2) to Gemfile to use #has_secure_password:
+ # You need to add bcrypt (~> 3.1.7) to Gemfile to use #has_secure_password:
#
- # gem 'bcrypt-ruby', '~> 3.1.2'
+ # gem 'bcrypt', '~> 3.1.7'
#
# Example using Active Record (which automatically includes ActiveModel::SecurePassword):
#
@@ -40,13 +40,13 @@ module ClassMethods
# User.find_by(name: 'david').try(:authenticate, 'notright') # => false
# User.find_by(name: 'david').try(:authenticate, 'mUc3m00RsqyRe') # => user
def has_secure_password(options = {})
- # Load bcrypt-ruby only when has_secure_password is used.
+ # Load bcrypt gem only when has_secure_password is used.
# This is to avoid ActiveModel (and by extension the entire framework)
# being dependent on a binary library.
begin
require 'bcrypt'
rescue LoadError
- $stderr.puts "You don't have bcrypt-ruby installed in your application. Please add it to your Gemfile and run bundle install"
+ $stderr.puts "You don't have bcrypt installed in your application. Please add it to your Gemfile and run bundle install"
raise
end
View
2 guides/code/getting_started/Gemfile
@@ -31,7 +31,7 @@ end
gem 'jbuilder', '~> 1.2'
# To use ActiveModel has_secure_password
-# gem 'bcrypt-ruby', '~> 3.1.2'
+# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
View
2 railties/lib/rails/generators/rails/app/templates/Gemfile
@@ -16,7 +16,7 @@ group :doc do
end
# Use ActiveModel has_secure_password
-# gem 'bcrypt-ruby', '~> 3.1.2'
+# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'

0 comments on commit 772afef

Please sign in to comment.
Something went wrong with that request. Please try again.