handsome_fencer-crypto 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 15caadb79fe6ab8a376ce92b0ce89f290f820474763d614eea58e5add2eb91e7
4
+ data.tar.gz: e4346aaaf057fa9020221a60bc1ae1a647c65d56d3adeec0352511502458deb6
5
+ SHA512:
6
+ metadata.gz: fc9953504bd1e9289d0951a0344f8850e81168c89038c6c46d023efb88d68f0c7fac42f51504cc0e2f25dc0aa34016f56c3fa03a469fb94fef1b824d44499f98
7
+ data.tar.gz: a5846eb11ae4a31ce56dc8330df5928cc85865d715afeca76893a14a0294d14e1044c24dd397c1adb306740c38342980649c8d29ffa971f005d1b6a5e86fc2c3
data/.byebug_history ADDED
@@ -0,0 +1,82 @@
1
+ c
2
+ File.read(env_files.last)
3
+ env_files.last
4
+ env_files.last.read
5
+ c
6
+ source_files
7
+ c
8
+ source_files
9
+ c
10
+ environment
11
+ c
12
+ environment
13
+ c
14
+ exit
15
+ directory
16
+ environment
17
+ c
18
+ file.split('.')[-2].split('/').last
19
+ file.split('.')[-2].split('/')
20
+ file.split('.', '/')
21
+ file
22
+ environment
23
+ c
24
+ ls
25
+ exit
26
+ ENV[env_key]
27
+ c
28
+ env_key
29
+ c
30
+ ENV[env_key]
31
+ env_key
32
+ File.read(key_file)
33
+ key_file
34
+ c
35
+ exit
36
+ subject.get_key('production').size
37
+ subject.get_key('production')
38
+ exit
39
+ File.read key_file
40
+ key_file
41
+ c
42
+ File.read(key_file).size
43
+ File.read(key_file)
44
+ file.read(key_file)
45
+ c
46
+ File.read(key_file)
47
+ key_file
48
+ c
49
+ source_files('.', 'productiondd.key').first
50
+ source_files('.', 'productiondd.key').flatten
51
+ source_files('.', 'productiondd.key')
52
+ source_files('', 'productiondd.key')
53
+ "production".upcase + '_KEY'
54
+ ENV["production".upcase + '_KEY']
55
+ ENV['PATH']
56
+ ENV
57
+ env
58
+ printenv
59
+ env
60
+ c
61
+ source_files('', 'production.key')
62
+ source_files('.', 'production.key')
63
+ source_files('./.', 'production.key')
64
+ source_files('./.', '.key')
65
+ c
66
+ self.initialize
67
+ self
68
+ c
69
+ @pass_phrase
70
+ @cipher
71
+ exit
72
+ e
73
+ n
74
+ key
75
+ file
76
+ c
77
+ exit
78
+ extension
79
+ directory
80
+ environment
81
+ self
82
+ args
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.1
7
+ before_install: gem install bundler -v 1.17.2
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at fred.schoeneman@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in handsome_fencer-crypto.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,155 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ handsome_fencer-crypto (0.1.0)
5
+ guard
6
+ guard-minitest
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (5.2.2)
12
+ actionview (= 5.2.2)
13
+ activesupport (= 5.2.2)
14
+ rack (~> 2.0)
15
+ rack-test (>= 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
18
+ actionview (5.2.2)
19
+ activesupport (= 5.2.2)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
24
+ activesupport (5.2.2)
25
+ concurrent-ruby (~> 1.0, >= 1.0.2)
26
+ i18n (>= 0.7, < 2)
27
+ minitest (~> 5.1)
28
+ tzinfo (~> 1.1)
29
+ addressable (2.5.2)
30
+ public_suffix (>= 2.0.2, < 4.0)
31
+ builder (3.2.3)
32
+ byebug (10.0.2)
33
+ coderay (1.1.2)
34
+ concurrent-ruby (1.1.3)
35
+ crass (1.0.4)
36
+ em-websocket (0.5.1)
37
+ eventmachine (>= 0.12.9)
38
+ http_parser.rb (~> 0.6.0)
39
+ erubi (1.7.1)
40
+ eventmachine (1.2.7)
41
+ ffi (1.9.25)
42
+ formatador (0.2.5)
43
+ given_core (3.8.0)
44
+ sorcerer (>= 0.3.7)
45
+ guard (2.15.0)
46
+ formatador (>= 0.2.4)
47
+ listen (>= 2.7, < 4.0)
48
+ lumberjack (>= 1.0.12, < 2.0)
49
+ nenv (~> 0.1)
50
+ notiffany (~> 0.0)
51
+ pry (>= 0.9.12)
52
+ shellany (~> 0.0)
53
+ thor (>= 0.18.1)
54
+ guard-compat (1.2.1)
55
+ guard-livereload (2.5.2)
56
+ em-websocket (~> 0.5)
57
+ guard (~> 2.8)
58
+ guard-compat (~> 1.0)
59
+ multi_json (~> 1.8)
60
+ guard-minitest (2.4.6)
61
+ guard-compat (~> 1.2)
62
+ minitest (>= 3.0)
63
+ handsome_fencer-test (0.1.1)
64
+ guard
65
+ guard-livereload
66
+ guard-minitest
67
+ launchy
68
+ minitest-given
69
+ minitest-matchers_vaccine
70
+ minitest-rails
71
+ rack-livereload
72
+ shoulda
73
+ shoulda-matchers
74
+ thor
75
+ http_parser.rb (0.6.0)
76
+ i18n (1.2.0)
77
+ concurrent-ruby (~> 1.0)
78
+ launchy (2.4.3)
79
+ addressable (~> 2.3)
80
+ listen (3.1.5)
81
+ rb-fsevent (~> 0.9, >= 0.9.4)
82
+ rb-inotify (~> 0.9, >= 0.9.7)
83
+ ruby_dep (~> 1.2)
84
+ loofah (2.2.3)
85
+ crass (~> 1.0.2)
86
+ nokogiri (>= 1.5.9)
87
+ lumberjack (1.0.13)
88
+ method_source (0.9.2)
89
+ mini_portile2 (2.3.0)
90
+ minitest (5.11.3)
91
+ minitest-given (3.8.0)
92
+ given_core (= 3.8.0)
93
+ minitest (> 4.3)
94
+ minitest-matchers_vaccine (1.0.4)
95
+ minitest (~> 5.0)
96
+ minitest-rails (3.0.0)
97
+ minitest (~> 5.8)
98
+ railties (~> 5.0)
99
+ multi_json (1.13.1)
100
+ nenv (0.3.0)
101
+ nokogiri (1.8.5)
102
+ mini_portile2 (~> 2.3.0)
103
+ notiffany (0.1.1)
104
+ nenv (~> 0.1)
105
+ shellany (~> 0.0)
106
+ pry (0.12.2)
107
+ coderay (~> 1.1.0)
108
+ method_source (~> 0.9.0)
109
+ public_suffix (3.0.3)
110
+ rack (2.0.6)
111
+ rack-livereload (0.3.17)
112
+ rack
113
+ rack-test (1.1.0)
114
+ rack (>= 1.0, < 3)
115
+ rails-dom-testing (2.0.3)
116
+ activesupport (>= 4.2.0)
117
+ nokogiri (>= 1.6)
118
+ rails-html-sanitizer (1.0.4)
119
+ loofah (~> 2.2, >= 2.2.2)
120
+ railties (5.2.2)
121
+ actionpack (= 5.2.2)
122
+ activesupport (= 5.2.2)
123
+ method_source
124
+ rake (>= 0.8.7)
125
+ thor (>= 0.19.0, < 2.0)
126
+ rake (10.5.0)
127
+ rb-fsevent (0.10.3)
128
+ rb-inotify (0.9.10)
129
+ ffi (>= 0.5.0, < 2)
130
+ ruby_dep (1.5.0)
131
+ shellany (0.0.1)
132
+ shoulda (3.6.0)
133
+ shoulda-context (~> 1.0, >= 1.0.1)
134
+ shoulda-matchers (~> 3.0)
135
+ shoulda-context (1.2.2)
136
+ shoulda-matchers (3.1.2)
137
+ activesupport (>= 4.0.0)
138
+ sorcerer (1.0.2)
139
+ thor (0.20.3)
140
+ thread_safe (0.3.6)
141
+ tzinfo (1.2.5)
142
+ thread_safe (~> 0.1)
143
+
144
+ PLATFORMS
145
+ ruby
146
+
147
+ DEPENDENCIES
148
+ bundler (~> 1.17)
149
+ byebug
150
+ handsome_fencer-crypto!
151
+ handsome_fencer-test
152
+ rake (~> 10.0)
153
+
154
+ BUNDLED WITH
155
+ 1.17.2
data/Guardfile ADDED
@@ -0,0 +1,26 @@
1
+
2
+ guard :minitest do
3
+ # with Minitest::Unit
4
+ # watch(%r{^test/(.*)\/?test_(.*)\.rb$})
5
+ # watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
6
+ # watch(%r{^test/test_helper\.rb$}) { 'test' }
7
+
8
+ # with Minitest::Spec
9
+ watch(%r{^test/(.*)_test\.rb$})
10
+ watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
11
+ watch(%r{^test/test_helper\.rb$}) { 'test' }
12
+
13
+ # Rails 4
14
+ # watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
15
+ # watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
16
+ # watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" }
17
+ # watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
18
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" }
19
+ # watch(%r{^test/.+_test\.rb$})
20
+ # watch(%r{^test/test_helper\.rb$}) { 'test' }
21
+
22
+ # Rails < 4
23
+ # watch(%r{^app/controllers/(.*)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
24
+ # watch(%r{^app/helpers/(.*)\.rb$}) { |m| "test/helpers/#{m[1]}_test.rb" }
25
+ # watch(%r{^app/models/(.*)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
26
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 schadenfred
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # HandsomeFencer::Crypto
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/handsome_fencer/crypto`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'handsome_fencer-crypto'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install handsome_fencer-crypto
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/handsome_fencer-crypto. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the HandsomeFencer::Crypto project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/handsome_fencer-crypto/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "handsome_fencer/crypto"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,36 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "handsome_fencer/crypto/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "handsome_fencer-crypto"
8
+ spec.version = HandsomeFencer::Crypto::VERSION
9
+ spec.authors = ["schadenfred"]
10
+ spec.email = ["fred.schoeneman@gmail.com"]
11
+
12
+ spec.summary = %q{Crypto using OpenSSL}
13
+ spec.description = %q{Used by HFCI.}
14
+ spec.homepage = "https://github.com/schadenfred/handsome_fencer-crypto"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
23
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ end
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.add_dependency "guard"
30
+ spec.add_dependency "guard-minitest"
31
+
32
+ spec.add_development_dependency "bundler", "~> 1.17"
33
+ spec.add_development_dependency "rake", "~> 10.0"
34
+ spec.add_development_dependency "handsome_fencer-test"
35
+ spec.add_development_dependency "byebug"
36
+ end
@@ -0,0 +1,76 @@
1
+ require "handsome_fencer/crypto/version"
2
+ require "openssl"
3
+ require "base64"
4
+
5
+ module HandsomeFencer::Crypto
6
+
7
+ class << self
8
+
9
+ def generate_key
10
+ @cipher = OpenSSL::Cipher.new 'AES-128-CBC'
11
+ @salt = '8 octets'
12
+ @new_key = @cipher.random_key
13
+ Base64.encode64(@new_key)
14
+ end
15
+
16
+ def write_to_file(data, filename)
17
+ File.open(filename, "w") { |io| io.write data }
18
+ end
19
+
20
+ def generate_key_file(directory, environment)
21
+ write_to_file(generate_key, directory + "/" + environment + ".key")
22
+ end
23
+
24
+ def source_files(directory=nil, extension=nil)
25
+ Dir.glob(directory + "/**/*#{extension}")
26
+ end
27
+
28
+ def build_cipher(environment)
29
+ @cipher = OpenSSL::Cipher.new 'AES-128-CBC'
30
+ @salt = '8 octets'
31
+ @pass_phrase = get_key(environment)
32
+ @cipher.encrypt.pkcs5_keyivgen @pass_phrase, @salt
33
+ end
34
+
35
+ def encrypt(file, environment=nil)
36
+ environment ||= file.split('.')[-2].split('/').last
37
+ build_cipher(environment)
38
+ encrypted = @cipher.update(File.read file) + @cipher.final
39
+ write_to_file(Base64.encode64(encrypted), file + '.enc')
40
+ end
41
+
42
+ def decrypt(file, environment=nil)
43
+ environment ||= file.split('.')[-3].split('/').last
44
+ build_cipher(environment)
45
+ encrypted = Base64.decode64 File.read(file)
46
+ @cipher.decrypt.pkcs5_keyivgen @pass_phrase, @salt
47
+ decrypted = @cipher.update(encrypted) + @cipher.final
48
+ decrypted_file = file.split('.enc').first
49
+ write_to_file decrypted, decrypted_file
50
+ end
51
+
52
+ def obfuscate(env=nil, dir=nil, ext=nil)
53
+ ext = ext || '.env'
54
+ source_files(dir, ext).each { |file| encrypt(file, env) }
55
+ end
56
+
57
+ def expose(env=nil, dir=nil, ext=nil)
58
+ ext = ext || '.env.enc'
59
+ dir = dir || 'docker'
60
+ source_files(dir, ext).each { |file| decrypt(file, env) }
61
+ end
62
+
63
+ def get_key(environment, directory=nil)
64
+ env_key = environment.upcase + '_KEY'
65
+ key_file = source_files('./.', "#{directory}/#{environment}.key").first
66
+ case
67
+ when ENV[env_key].nil? && key_file.nil?
68
+ raise DeployKeyError, "No #{env_key} set."
69
+ when ENV[env_key]
70
+ ENV[env_key]
71
+ when File.exist?(key_file)
72
+ File.read(key_file)
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,5 @@
1
+ module HandsomeFencer
2
+ module Crypto
3
+ VERSION = "0.1.2"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: handsome_fencer-crypto
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - schadenfred
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-12-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: guard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: guard-minitest
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.17'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.17'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: handsome_fencer-test
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: byebug
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: Used by HFCI.
98
+ email:
99
+ - fred.schoeneman@gmail.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".byebug_history"
105
+ - ".gitignore"
106
+ - ".travis.yml"
107
+ - CODE_OF_CONDUCT.md
108
+ - Gemfile
109
+ - Gemfile.lock
110
+ - Guardfile
111
+ - LICENSE.txt
112
+ - README.md
113
+ - Rakefile
114
+ - bin/console
115
+ - bin/setup
116
+ - handsome_fencer-crypto.gemspec
117
+ - lib/handsome_fencer/crypto.rb
118
+ - lib/handsome_fencer/crypto/version.rb
119
+ homepage: https://github.com/schadenfred/handsome_fencer-crypto
120
+ licenses:
121
+ - MIT
122
+ metadata: {}
123
+ post_install_message:
124
+ rdoc_options: []
125
+ require_paths:
126
+ - lib
127
+ required_ruby_version: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ required_rubygems_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ requirements: []
138
+ rubyforge_project:
139
+ rubygems_version: 2.7.7
140
+ signing_key:
141
+ specification_version: 4
142
+ summary: Crypto using OpenSSL
143
+ test_files: []