encrypt_env 0.0.1 → 0.0.4

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/encrypt_env +23 -28
  3. data/lib/encrypt_env.rb +1 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b1d40fa9ca8ef216853ca8d51429160f004128d8572404eb0afd1c60fecfb2e
4
- data.tar.gz: ab593ee463cad59212b6d6309e5978444f8b4a5a1fb32599197934c868adfe75
3
+ metadata.gz: e5e431e0af0fe05b0f3626fc7c6eb39cb73777f00f167a63a8d7a938eba3ab38
4
+ data.tar.gz: 78cc5ae194051528b04755099e3783b44f27e8a3550d01065dcf36d3edd76d44
5
5
  SHA512:
6
- metadata.gz: 5211fb5a52284fd8d6a0942c42800d76a129af36a46a2c2561b6f3c88f3ea252d94a0115ac3bb22326a3e3906ab88336e78ea79bff9460b10b401d45a2229f22
7
- data.tar.gz: fab9413d7dd115c7008ae2f177a19317876f5af1951b8cc8e6f47ca98dea931d39b5de2ded826abdc27810c85a96b59613dd6a1b5b55c8f99b1d904059ce964e
6
+ metadata.gz: 340aee1f184202f43a34ea8a18a6996bca83f5517dfd0640c4094819f725eebd51e3829fdaf92d3e15c4cc90d7d04c75082bbeb66310636667852097b9b74905
7
+ data.tar.gz: c35d1761ed73e5ac77c9f8c7736cea1d6fe2cc50b61916acb926c917f7fed34b9c1e30763a10e4ecd44032be6e4635cbda720e11cb7d345193982b2270f68a59
data/bin/encrypt_env CHANGED
@@ -4,37 +4,32 @@
4
4
 
5
5
  require 'encrypt_env'
6
6
 
7
- COMMANDS = {
8
- 'setup' => EncryptEnv.setup,
9
- 'secrets' => EncryptEnv.secrets,
10
- 'secrets_all' => EncryptEnv.secrets_all,
11
- 'edit' => EncryptEnv.edit
12
- }.freeze
13
-
14
7
  argv = ARGV
15
8
  action = argv.shift
16
- command_class = COMMANDS[action]
17
- unless command_class
18
- if ['help', '--help', '-h'].include?(action)
19
- puts <<~HELP
20
- Usage:
21
- encrypt_env setup
22
- encrypt_env secrets
23
- encrypt_env secrets_all
24
- encrypt_env edit
25
- HELP
26
9
 
27
- exit 0
28
- else
29
- puts "Unknown action: #{action}"
30
- exit 1
31
- end
32
- end
10
+ if action == 'setup'
11
+ EncryptEnv.setup
12
+ exit 0
13
+ elsif action == 'show'
14
+ EncryptEnv.secrets
15
+ exit 0
16
+ elsif action == 'all'
17
+ EncryptEnv.secrets_all
18
+ exit 0
19
+ elsif action == 'edit'
20
+ EncryptEnv.edit
21
+ exit 0
22
+ elsif ['help', '--help', '-h'].include?(action)
23
+ puts <<~HELP
24
+ Usage:
25
+ encrypt_env setup
26
+ encrypt_env secrets
27
+ encrypt_env secrets_all
28
+ encrypt_env edit
29
+ HELP
33
30
 
34
- begin
35
- command = command_class.new(argv)
36
- command.run!
37
- rescue ArgumentError => e
38
- puts e.message
31
+ exit 0
32
+ else
33
+ puts "Unknown action: #{action}"
39
34
  exit 1
40
35
  end
data/lib/encrypt_env.rb CHANGED
@@ -4,6 +4,7 @@ require 'securerandom'
4
4
  require 'openssl'
5
5
  require 'yaml'
6
6
  require 'active_support/core_ext/hash/indifferent_access'
7
+ require 'tempfile'
7
8
 
8
9
  # gem 'encrypt_env'
9
10
  class EncryptEnv
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: encrypt_env
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nhu Tan