google-api 0.2.0 → 0.3.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.3.0 (2012-11-24)
2
+
3
+ * Save encrypted values as Base64-encoded strings. (NOTE: This is a non-backward compatible change!)
4
+
1
5
  ## v0.2.0 (2012-11-24)
2
6
 
3
7
  * Rewrite token encryption to use OpenSSL's Cipher. (NOTE: This is a non-backward compatible change!)
data/google-api.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
11
11
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
12
12
  gem.name = "google-api"
13
13
  gem.require_paths = ["lib"]
14
- gem.version = "0.2.0"
14
+ gem.version = "0.3.0"
15
15
 
16
16
  gem.add_runtime_dependency 'mime-types', '~> 1.0'
17
17
  gem.add_runtime_dependency 'oauth2', '~> 0.8.0'
@@ -4,11 +4,11 @@ module GoogleAPI
4
4
  class << self
5
5
 
6
6
  def encrypt!(value)
7
- crypt(:encrypt, value)
7
+ Base64.strict_encode64(crypt(:encrypt, value))
8
8
  end
9
9
 
10
10
  def decrypt!(value)
11
- crypt(:decrypt, value)
11
+ crypt(:decrypt, Base64.strict_decode64(value))
12
12
  end
13
13
 
14
14
  protected
@@ -13,7 +13,7 @@ describe GoogleAPI::Encrypter do
13
13
  describe "#encrypt!" do
14
14
 
15
15
  it "should return an encrypted version of the string" do
16
- GoogleAPI::Encrypter.encrypt!('test').should == "0\xC2\xF3y\b\xA00\xB1\x9C\xBD;\xC7s61\x8E"
16
+ GoogleAPI::Encrypter.encrypt!('test').should == "MMLzeQigMLGcvTvHczYxjg=="
17
17
  end
18
18
 
19
19
  end
@@ -21,7 +21,7 @@ describe GoogleAPI::Encrypter do
21
21
  describe "#decrypt!" do
22
22
 
23
23
  it "should return an decrypted version of the string" do
24
- GoogleAPI::Encrypter.decrypt!("0\xC2\xF3y\b\xA00\xB1\x9C\xBD;\xC7s61\x8E").should == 'test'
24
+ GoogleAPI::Encrypter.decrypt!("MMLzeQigMLGcvTvHczYxjg==").should == 'test'
25
25
  end
26
26
 
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
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: 2012-11-24 00:00:00.000000000 Z
12
+ date: 2012-11-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mime-types
@@ -158,7 +158,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  segments:
160
160
  - 0
161
- hash: 1675511776149438759
161
+ hash: -5125409393487118
162
162
  required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  none: false
164
164
  requirements:
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  version: '0'
168
168
  segments:
169
169
  - 0
170
- hash: 1675511776149438759
170
+ hash: -5125409393487118
171
171
  requirements: []
172
172
  rubyforge_project:
173
173
  rubygems_version: 1.8.24