obfuscate 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- obfuscate (0.0.2)
4
+ obfuscate (0.0.4)
5
5
  crypt19 (~> 1.2.0)
6
6
 
7
7
  GEM
@@ -58,7 +58,11 @@ module Obfuscate
58
58
  # Clarifies obfuscated Model id
59
59
  # @return [String]
60
60
  def clarify_id( text )
61
- self.obfuscatable_crypt.clarify( text, :block )
61
+ begin
62
+ self.obfuscatable_crypt.clarify( text, :block )
63
+ rescue ArgumentError
64
+ # invalid text passed in, causing a Base64 decode error, ignore.
65
+ end
62
66
  end
63
67
 
64
68
  # Clarify obfuscated text.
@@ -14,5 +14,5 @@
14
14
  # the License.
15
15
 
16
16
  module Obfuscate
17
- VERSION = "0.0.3"
17
+ VERSION = "0.0.4"
18
18
  end
@@ -53,6 +53,11 @@ describe Obfuscate::Obfuscatable do
53
53
  model.clarify_id( model.obfuscated_id ).to_i.should eql model.id
54
54
  end
55
55
 
56
+ it "should ignore bad obfuscated id" do
57
+ model.clarify_id( 7 ).should be_nil
58
+ model.clarify_id( "!@#$@%@#%@^%" ).should be_nil
59
+ end
60
+
56
61
  it "should find_by_obfuscated_id" do
57
62
  Message.find_by_obfuscated_id( model.obfuscated_id ).should eql model
58
63
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obfuscate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-04 00:00:00.000000000 Z
12
+ date: 2013-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: crypt19