Skip to content

Commit 38f803a

Browse files
committed
Fix class-level defaults not working when inherited
1 parent f28334c commit 38f803a

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎CHANGELOG.rdoc‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
== master
22

3+
* Fix class-level defaults not working when inherited
4+
35
== 0.2.0 / 2008-12-01
46

57
* Remove AsymmetricEncryptor.default_algorithm, instead relying on SymmetricEncryptor.default_algorithm

‎lib/encrypted_strings/asymmetric_cipher.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ def initialize(options = {})
8686
raise ArgumentError, "Unknown key(s): #{invalid_options.join(", ")}" unless invalid_options.empty?
8787

8888
options = {
89-
:private_key_file => self.class.default_private_key_file,
90-
:public_key_file => self.class.default_public_key_file
89+
:private_key_file => AsymmetricCipher.default_private_key_file,
90+
:public_key_file => AsymmetricCipher.default_public_key_file
9191
}.merge(options)
9292

9393
@public_key = @private_key = nil

‎lib/encrypted_strings/sha_cipher.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def initialize(options = {})
4747
invalid_options = options.keys - [:salt]
4848
raise ArgumentError, "Unknown key(s): #{invalid_options.join(", ")}" unless invalid_options.empty?
4949

50-
options = {:salt => self.class.default_salt}.merge(options)
50+
options = {:salt => ShaCipher.default_salt}.merge(options)
5151

5252
self.salt = options[:salt].to_s
5353

‎lib/encrypted_strings/symmetric_cipher.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def initialize(options = {})
6868
raise ArgumentError, "Unknown key(s): #{invalid_options.join(", ")}" unless invalid_options.empty?
6969

7070
options = {
71-
:algorithm => self.class.default_algorithm,
72-
:password => self.class.default_password
71+
:algorithm => SymmetricCipher.default_algorithm,
72+
:password => SymmetricCipher.default_password
7373
}.merge(options)
7474

7575
self.algorithm = options[:algorithm]

0 commit comments

Comments
 (0)