encryption_activator 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MTgxMDNjNzhiY2FlYWQ4ZGY5YWE5ZTkwNTJiMGI3NGVhMjk5MTEyOA==
5
+ data.tar.gz: !binary |-
6
+ NDczNzBjMDRmYWRmMjZhOTg3YzVmMTU4ZDViNWM1YmU3ZTY3NzhhMg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YWU5MjcyNmUwMGFhMzVkOThiMWQzNGIxNWVkNjM0ZjgyYTg5MzZhNDBmNjRi
10
+ Y2U5YjVmZjNhYmQ5MTY1OGEwYjQ5ZmZmNGNiZGY0NDliZmZhODllMDdiZjg4
11
+ ODkwOTkxMTE0OTIxNzlkODRlZGJiOWEyMDE4YzQ3OTI0ZjRhNWU=
12
+ data.tar.gz: !binary |-
13
+ ZmQwZWQwNjA0NjJlMmEyNTIwN2I4NTg2NmM0OWFkMTU3ZDgyMjdjZDVkMTBk
14
+ YTgwNWYwZjQ4M2NmOWI5NTE0MDUxOTE2NDI2NmE4ZWVkMWQ4M2ZiMGVmNTM2
15
+ MjY0MTg3ZWJhOTBmYTU0MjNhOWU0NTNlZmNhMTU4ZDQwZDI4ODY=
data/CHANGELOG CHANGED
@@ -1 +1,3 @@
1
+ v0.2. Support key from env var
2
+
1
3
  v0.1. Proof of concept
data/Manifest CHANGED
@@ -1,6 +1,6 @@
1
1
  CHANGELOG
2
+ Manifest
2
3
  README.md
3
4
  Rakefile
4
5
  lib/encryption_activator.rb
5
6
  test/test_all.rb
6
- Manifest
data/README.md CHANGED
@@ -37,3 +37,5 @@ startup thread, you call this:
37
37
  EncryptionActivator.prompt
38
38
 
39
39
  After this, the app can read and write the encrypted fields.
40
+
41
+ OR you can use the environment variable ENCRYPTION_ACTIVATOR_KEY
@@ -2,29 +2,20 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "encryption_activator"
5
- s.version = "0.1"
5
+ s.version = "0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Andrew Snow"]
9
- s.date = "2013-02-18"
9
+ s.date = "2013-03-08"
10
10
  s.description = "Ruby gem to prompt for password at run time for attr_encrypted"
11
11
  s.email = "andrew@modulus.org"
12
12
  s.extra_rdoc_files = ["CHANGELOG", "README.md", "lib/encryption_activator.rb"]
13
- s.files = ["CHANGELOG", "README.md", "Rakefile", "lib/encryption_activator.rb", "test/test_all.rb", "Manifest", "encryption_activator.gemspec"]
13
+ s.files = ["CHANGELOG", "Manifest", "README.md", "Rakefile", "lib/encryption_activator.rb", "test/test_all.rb", "encryption_activator.gemspec"]
14
14
  s.homepage = "https://github.com/andys/encryption_activator"
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Encryption_activator", "--main", "README.md"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = "encryption_activator"
18
- s.rubygems_version = "1.8.25"
18
+ s.rubygems_version = "2.0.2"
19
19
  s.summary = "Ruby gem to prompt for password at run time for attr_encrypted"
20
20
  s.test_files = ["test/test_all.rb"]
21
-
22
- if s.respond_to? :specification_version then
23
- s.specification_version = 3
24
-
25
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
- else
27
- end
28
- else
29
- end
30
21
  end
@@ -31,7 +31,7 @@ module EncryptionActivator
31
31
  end
32
32
 
33
33
  def keyproc
34
- lambda {|*opts| @key || raise(EncryptionActivator::KeyNotSetException.new("Key not set!")) }
34
+ lambda {|*opts| @key || ENV['ENCRYPTION_ACTIVATOR_KEY'] || raise(EncryptionActivator::KeyNotSetException.new("Key not set!")) }
35
35
  end
36
36
 
37
37
  def key
data/test/test_all.rb CHANGED
@@ -6,6 +6,7 @@ class TestEncryptionActivator < MiniTest::Unit::TestCase
6
6
 
7
7
  def setup
8
8
  EncryptionActivator.key = nil
9
+ ENV['ENCRYPTION_ACTIVATOR_KEY'] = nil
9
10
  end
10
11
 
11
12
  def test_key_entry_good
@@ -33,4 +34,10 @@ class TestEncryptionActivator < MiniTest::Unit::TestCase
33
34
  EncryptionActivator.key = 'flibble'
34
35
  assert_equal 'flibble', EncryptionActivator.key
35
36
  end
37
+
38
+ def test_key_env_var
39
+ ENV['ENCRYPTION_ACTIVATOR_KEY'] = 'flibble'
40
+ assert_equal 'flibble', EncryptionActivator.key
41
+ end
42
+
36
43
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: encryption_activator
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
5
- prerelease:
4
+ version: '0.2'
6
5
  platform: ruby
7
6
  authors:
8
7
  - Andrew Snow
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-18 00:00:00.000000000 Z
11
+ date: 2013-03-08 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Ruby gem to prompt for password at run time for attr_encrypted
15
14
  email: andrew@modulus.org
@@ -21,14 +20,15 @@ extra_rdoc_files:
21
20
  - lib/encryption_activator.rb
22
21
  files:
23
22
  - CHANGELOG
23
+ - Manifest
24
24
  - README.md
25
25
  - Rakefile
26
26
  - lib/encryption_activator.rb
27
27
  - test/test_all.rb
28
- - Manifest
29
28
  - encryption_activator.gemspec
30
29
  homepage: https://github.com/andys/encryption_activator
31
30
  licenses: []
31
+ metadata: {}
32
32
  post_install_message:
33
33
  rdoc_options:
34
34
  - --line-numbers
@@ -40,22 +40,20 @@ rdoc_options:
40
40
  require_paths:
41
41
  - lib
42
42
  required_ruby_version: !ruby/object:Gem::Requirement
43
- none: false
44
43
  requirements:
45
44
  - - ! '>='
46
45
  - !ruby/object:Gem::Version
47
46
  version: '0'
48
47
  required_rubygems_version: !ruby/object:Gem::Requirement
49
- none: false
50
48
  requirements:
51
49
  - - ! '>='
52
50
  - !ruby/object:Gem::Version
53
51
  version: '1.2'
54
52
  requirements: []
55
53
  rubyforge_project: encryption_activator
56
- rubygems_version: 1.8.25
54
+ rubygems_version: 2.0.2
57
55
  signing_key:
58
- specification_version: 3
56
+ specification_version: 4
59
57
  summary: Ruby gem to prompt for password at run time for attr_encrypted
60
58
  test_files:
61
59
  - test/test_all.rb