encryption 1.0.1 → 1.0.2

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2EyM2Q4MWUzM2VhZGE3ZmE5YmM2MGQ5N2Y2MTM0YzVjOWNhOTkwOQ==
4
+ MGJmMmI0ZDNlMGYyY2RlZDFhNDVkYmZkNGU0YmRjZmQ1NTViMDI5Yw==
5
5
  data.tar.gz: !binary |-
6
- YzQ1NjNkZDg0MWExNTZmN2YzNGMzNzczZTJjOGEzMWViNWYwOTc1ZA==
6
+ NjhhNjdjMDIxMGM5ZjViOTFlMDQ4MDc4NWUyMWE3MjI0NWExMGVmZA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MjY3NDQzYzQwNTY3OTA5Yzc2MDRiYmE1N2Y5ODhjZWZlMmZhNjdiNDQ5ZmU3
10
- ZDU4ZmEwNDJkZWY1ZmRkZjM2NTU5NTc2YzhmZDE4ODQ0ZTI2NzIyZTBmN2Rj
11
- YjJlM2FkOGM1NmE3NmFiNjkyODQwMzI2NTc2NGY4NjhlNzhkNGQ=
9
+ OGNiYzAyZDk1ZjY0NTkwNzZmMGI2ZWUzMjExMWU1ZmZjODQ3NzIzYTJjMmRm
10
+ MjJmNmNjNGY0ZGIyYTYxMTkxNzQ3NDk4MTAwN2U3MzBlZjY2NGM2M2IwMDFk
11
+ Y2E1MjNmMmM4ZGJkMzljNzZlMDk2NWY1ZGM4ZTU3Mzc2MDNhZTY=
12
12
  data.tar.gz: !binary |-
13
- ZTA3ZmZlM2I1OGZiNDg1OWQyZWQ2Nzc4ODA0NzliZmVmY2YyMzE0Yzc3NGJl
14
- NzNjNWJmN2ZiMGZjMDZjZjU4NTU4NWRiOGM5OWI5ODAxZmY4MDQ1OTlkYWMw
15
- NDE2YTdiOTM4YTE1MWIzNmI2ZmM0OWE5NWVhNGNiYjQ2MTgzYzU=
13
+ ZjU3MzZlNDkxNWZhMzUzZTQ4ZDQ1ZTEwMDAyMTFhZWYzOTI2Y2U1Y2Y1NzA3
14
+ ZWE5NmMxMjAwMGU0NTU3MmEzNWQyYzA0MTZlNGE3ZTljZGY5N2RhMjA0NjRj
15
+ MzI4ZGU2YTc5NzY5MzcxODdiNjg2OTE2NTRmY2ExNTI5MGEyY2E=
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
5
+ - 1.9.2
6
+ - jruby-19mode
7
+ - rbx-19mode
data/Gemfile CHANGED
@@ -2,4 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'rspec'
5
+ gem 'rake'
6
+
7
+ gem 'rspec'
data/Gemfile.lock CHANGED
@@ -7,6 +7,7 @@ GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  diff-lcs (1.2.1)
10
+ rake (10.0.4)
10
11
  rspec (2.13.0)
11
12
  rspec-core (~> 2.13.0)
12
13
  rspec-expectations (~> 2.13.0)
@@ -21,4 +22,5 @@ PLATFORMS
21
22
 
22
23
  DEPENDENCIES
23
24
  encryption!
25
+ rake
24
26
  rspec
data/README.md CHANGED
@@ -2,6 +2,7 @@ Encryption
2
2
  ==========
3
3
 
4
4
  [![Code Climate](https://codeclimate.com/github/Itehnological/encryption.png)](https://codeclimate.com/github/Itehnological/encryption)
5
+ [![Build Status](https://travis-ci.org/Itehnological/encryption.png)](https://travis-ci.org/Itehnological/encryption)
5
6
 
6
7
  A simple wrapper for the OpenSSL Cipher library
7
8
 
data/encryption.gemspec CHANGED
@@ -2,10 +2,10 @@ $LOAD_PATH << File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'encryption'
5
- s.version = '1.0.1'
6
- s.date = '2013-03-24'
5
+ s.version = '1.0.2'
6
+ s.date = Date.today.to_s
7
7
  s.summary = 'A simple wrapper for the OpenSSL Cipher library'
8
- s.description = 'A simple wrapper for the OpenSSL Cipher library'
8
+ s.description = 'Encryption provides a simple interface for encryption and decryption with the OpenSSL Cipher library'
9
9
  s.authors = ['Itay Grudev']
10
10
  s.email = ['itay.grudev@gmail.com']
11
11
  s.homepage = 'https://github.com/Itehnological/encryption'
@@ -3,9 +3,9 @@ module Encryption
3
3
 
4
4
  def initialize
5
5
  @config = {
6
- key: nil,
7
- iv: "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
8
- cipher: 'aes-256-cbc'
6
+ :key => nil,
7
+ :iv => "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
8
+ :cipher => 'aes-256-cbc'
9
9
  }
10
10
  end
11
11
 
@@ -16,7 +16,7 @@ module Encryption
16
16
  def method_missing(name, *args)
17
17
 
18
18
  return @config[name.to_sym] if is_valid_getter(name)
19
- return @config[name[0...-1].to_sym] = args[0] if is_valid_setter(name)
19
+ return @config[name[0..-2].to_sym] = args[0] if is_valid_setter(name)
20
20
 
21
21
  super
22
22
  end
@@ -33,7 +33,8 @@ module Encryption
33
33
  end
34
34
 
35
35
  def is_valid_setter(name)
36
- name[-1] == '=' and @config.has_key? name[0...-1].to_sym
36
+ name = name.to_s
37
+ name[-1] == '=' and @config.has_key? name[0..-2].to_sym
37
38
  end
38
39
 
39
40
  end
@@ -51,11 +51,5 @@ describe Encryption do
51
51
  encrypted1.should eq encrypted2
52
52
  end
53
53
 
54
- it "should have the same encoding for original and decrypted string" do
55
- encrypted = Encryption.encrypt(@original)
56
- decrypted = Encryption.decrypt(encrypted)
57
- decrypted.encoding.should eq @original.encoding
58
- end
59
-
60
54
  end
61
55
  end
@@ -55,12 +55,6 @@ describe Encryption::Encryptor do
55
55
  encrypted2 = @encryptor.encrypt(@original)
56
56
  encrypted1.should eq encrypted2
57
57
  end
58
-
59
- it "should have the same encoding for original and decrypted string" do
60
- encrypted = @encryptor.encrypt(@original)
61
- decrypted = @encryptor.decrypt(encrypted)
62
- decrypted.encoding.should eq @original.encoding
63
- end
64
58
  end
65
59
 
66
60
  end
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: encryption
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Itay Grudev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-24 00:00:00.000000000 Z
11
+ date: 2013-03-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: A simple wrapper for the OpenSSL Cipher library
13
+ description: Encryption provides a simple interface for encryption and decryption
14
+ with the OpenSSL Cipher library
14
15
  email:
15
16
  - itay.grudev@gmail.com
16
17
  executables: []
@@ -18,6 +19,7 @@ extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
20
21
  - .rspec
22
+ - .travis.yml
21
23
  - Gemfile
22
24
  - Gemfile.lock
23
25
  - LICENSE