encrypt_env 1.3.4 → 1.3.7
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 +4 -4
- data/bin/encrypt_env +22 -9
- data/lib/encrypt_env/version.rb +1 -1
- data/lib/encrypt_env.rb +2 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd634e7fc896cefbe4579145c0a73894ed1fe51be4971d8d195f0cbc0eb39b7d
|
4
|
+
data.tar.gz: f1471056a4779bfa5cef533495ca0abc09707bd6b13a35482a9d16642356e0e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa1e838872bade1d4d17cd0d222bc3c4e0c614738cd3e257a161dfc83198b41be2ff7a964f48ad11d5dc5cab2a9cda1373fc29dc3746e04c26e2a7fc83762097
|
7
|
+
data.tar.gz: 914b09bd8214792cb400753f5605ba7ba68fdcf2abd20e4254bd548768076ff0cf24a55312cd1c1f29e54370f56875e4371f7e359f6feaa3ab61cae1520b5fe5
|
data/bin/encrypt_env
CHANGED
@@ -7,14 +7,23 @@ require 'optparse'
|
|
7
7
|
require_relative '../lib/encrypt_env/version'
|
8
8
|
|
9
9
|
options = {}
|
10
|
-
|
11
|
-
parser.on('-e', '--environment ENVIRONMENT', 'environment')
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
OptionParser.new do |parser|
|
11
|
+
parser.on('-e', '--environment ENVIRONMENT', 'environment') do |opts|
|
12
|
+
options[:environment] = opts
|
13
|
+
end
|
14
|
+
|
15
|
+
parser.on('-s', '--set VALUE', 'value') do |opts|
|
16
|
+
options[:set] = opts
|
17
17
|
end
|
18
|
+
|
19
|
+
parser.on('-t', '--type TYPE', 'type of variable') do |opts|
|
20
|
+
options[:type] = opts
|
21
|
+
end
|
22
|
+
|
23
|
+
parser.on('-a', '--all', 'show all') do |_opts|
|
24
|
+
options[:all] = true
|
25
|
+
end
|
26
|
+
|
18
27
|
parser.on('-v', '--version', 'version') do
|
19
28
|
puts Version::VERSION
|
20
29
|
exit
|
@@ -46,9 +55,9 @@ parsers = OptionParser.new do |parser|
|
|
46
55
|
HELP
|
47
56
|
exit
|
48
57
|
end
|
49
|
-
end
|
58
|
+
end.parse!
|
50
59
|
|
51
|
-
parsers.parse!
|
60
|
+
# parsers.parse!
|
52
61
|
|
53
62
|
argv = ARGV
|
54
63
|
action = argv.shift
|
@@ -59,6 +68,10 @@ when 'setup'
|
|
59
68
|
EncryptEnv.setup
|
60
69
|
|
61
70
|
when 'show', 'edit'
|
71
|
+
if action == 'show' && options[:all]
|
72
|
+
EncryptEnv.show('all')
|
73
|
+
exit
|
74
|
+
end
|
62
75
|
EncryptEnv.send(action, options[:environment], variable_name)
|
63
76
|
|
64
77
|
when 'create'
|
data/lib/encrypt_env/version.rb
CHANGED
data/lib/encrypt_env.rb
CHANGED
@@ -121,7 +121,6 @@ class EncryptEnv
|
|
121
121
|
raise e.message
|
122
122
|
end
|
123
123
|
|
124
|
-
puts 'Decrypting...'
|
125
124
|
decipher = OpenSSL::Cipher.new('aes-128-gcm')
|
126
125
|
decipher.decrypt
|
127
126
|
data = load_encrypted_data(env)
|
@@ -293,13 +292,13 @@ class EncryptEnv
|
|
293
292
|
end
|
294
293
|
|
295
294
|
private_class_method def self.type_coercion(value, type)
|
295
|
+
type = define_type_new_variable if type.nil?
|
296
|
+
|
296
297
|
unless %w[integer float string boolean].include?(type)
|
297
298
|
puts "Variable's type must be 'interger', 'float', 'string' or 'boolean'!"
|
298
299
|
exit
|
299
300
|
end
|
300
301
|
|
301
|
-
type = define_type_new_variable if type.nil?
|
302
|
-
|
303
302
|
case type
|
304
303
|
when 'integer'
|
305
304
|
value.to_i
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: encrypt_env
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nhu Tan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|