ops_team 0.1.4 → 0.1.5
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/lib/ops.rb +1 -1
- data/lib/secrets.rb +23 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0131f82f1965a47c70c80d6d353159844ba315f2fd02c55ce91af2c0f3cf69d1
|
4
|
+
data.tar.gz: 244e1f3e044e16d1581057f4c98a1ae1264d0b18e632303a75341871c70d64f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddd7f8194e1628c659f515335c2bc33294a0cb67d1d9c4a1215509d482fa627f3248b4be9c6cd63465e71914bac6363ae0ced6bc07300da62b7db341d6cec21d
|
7
|
+
data.tar.gz: 4dadf01f5bbd5a875c2b5440d429c5fde2c90a85677b9e88ce1e2451200e6a82c23d3d6afca067ba73e77e14f312ef7b7f2223c7ad7c10dd48a69be0e4ec2953
|
data/lib/ops.rb
CHANGED
@@ -48,7 +48,7 @@ class Ops
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def builtin
|
51
|
-
@builtin ||= Builtins.const_get(builtin_class_name).new(@args, config)
|
51
|
+
@builtin ||= Builtins.const_get(builtin_class_name, false).new(@args, config)
|
52
52
|
rescue NameError
|
53
53
|
# this means there isn't a builtin with that name in that module
|
54
54
|
nil
|
data/lib/secrets.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Secrets
|
4
|
+
def initialize(filename)
|
5
|
+
@filename = filename
|
6
|
+
end
|
7
|
+
|
8
|
+
def load_into_environment
|
9
|
+
secrets['environment'].each do |key, value|
|
10
|
+
ENV[key] = value
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def secrets
|
17
|
+
@secrets ||= JSON.parse(file_contents)
|
18
|
+
end
|
19
|
+
|
20
|
+
def file_contents
|
21
|
+
filename.match(/\.ejson$/) ? `ejson decrypt #{filename}` : File.open(filename).read
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ops_team
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nickthecook@gmail.com
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- lib/ops.rb
|
83
83
|
- lib/options.rb
|
84
84
|
- lib/output.rb
|
85
|
+
- lib/secrets.rb
|
85
86
|
- loader.rb
|
86
87
|
homepage: https://github.com/nickthecook/ops
|
87
88
|
licenses:
|