Skip to content

Commit c2eae1c

Browse files
committed
Remove some old pre-bundler code
1 parent 9870375 commit c2eae1c

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

lib/authlogic/crypto_providers/bcrypt.rb

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
begin
2-
require "bcrypt"
3-
rescue LoadError
4-
"sudo gem install bcrypt-ruby"
5-
end
1+
require "bcrypt"
62

73
module Authlogic
84
module CryptoProviders
@@ -55,19 +51,19 @@ def cost
5551
@cost ||= 10
5652
end
5753
attr_writer :cost
58-
54+
5955
# Creates a BCrypt hash for the password passed.
6056
def encrypt(*tokens)
6157
::BCrypt::Password.create(join_tokens(tokens), :cost => cost)
6258
end
63-
59+
6460
# Does the hash match the tokens? Uses the same tokens that were used to encrypt.
6561
def matches?(hash, *tokens)
6662
hash = new_from_hash(hash)
6763
return false if hash.blank?
6864
hash == join_tokens(tokens)
6965
end
70-
66+
7167
# This method is used as a flag to tell Authlogic to "resave" the password upon a successful login, using the new cost
7268
def cost_matches?(hash)
7369
hash = new_from_hash(hash)
@@ -77,12 +73,12 @@ def cost_matches?(hash)
7773
hash.cost == cost
7874
end
7975
end
80-
76+
8177
private
8278
def join_tokens(tokens)
8379
tokens.flatten.join
8480
end
85-
81+
8682
def new_from_hash(hash)
8783
begin
8884
::BCrypt::Password.new(hash)

lib/authlogic/crypto_providers/scrypt.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
begin
2-
require "scrypt"
3-
rescue LoadError
4-
"sudo gem install scrypt"
5-
end
1+
require "scrypt"
62

73
module Authlogic
84
module CryptoProviders
@@ -67,7 +63,7 @@ def matches?(hash, *tokens)
6763
def join_tokens(tokens)
6864
tokens.flatten.join
6965
end
70-
66+
7167
def new_from_hash(hash)
7268
begin
7369
::SCrypt::Password.new(hash)

0 commit comments

Comments
 (0)