ops_team 0.6.0 → 0.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c66d41a99b01b2cb8a491c3fcc21c81914cf6981ffe757965940ad125f7d4721
4
- data.tar.gz: edb9c00bdef96370a79586638fc1541c5ad1e0ae301fe14053bc30004f149333
3
+ metadata.gz: 011b0f2a12af0a58c9b48f53d2dd59b9a753eab0acd221ee2675c296c7b109d0
4
+ data.tar.gz: 157963863ac30030921804a37f57ab332502ba465ac9c4ea139b18a297f0618e
5
5
  SHA512:
6
- metadata.gz: 1f1bbbd85e768c5f20b0d1fb70c28db11875aabadaf3fc647a2dc8c590be470cdab990c2fa9a657c02b7f6a2798eb5c2a94623d05aa9bb5ef95dd1706d742a6b
7
- data.tar.gz: 056d36e1c94f72709568d95e5eb2608a0804e9b322491cf1ff0a9fa4d17cefe5862e508aaf0d73bac5949dafbba8d2fcc8e6d6028235e2beb2b87410fa1cd5e3
6
+ metadata.gz: 9ce81eacd3adb1f7416a96adeabc38b244919ef8e8b17b349cea60e21a68535cc7aaeca57d8af1fb9fb1a03f7b94e98d423f018c2ecd2e9a4da556234ea64f65
7
+ data.tar.gz: 0e0b772bdd70841e197079c93124f53a0d61ea8558add16a4b89e2e7340a1dbeba58222a3631165c03ed3ea35c85c7c596f9834aa0ba3e0445196b27b35e3f41
@@ -1,6 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class AppConfig
4
+ class << self
5
+ def load
6
+ new(app_config_path).load
7
+ end
8
+
9
+ private
10
+
11
+ def app_config_path
12
+ expand_path(Options.get("config.path"))
13
+ end
14
+
15
+ def expand_path(path)
16
+ `echo #{path}`.chomp
17
+ end
18
+ end
19
+
4
20
  def initialize(filename = "")
5
21
  @filename = filename.empty? ? default_filename : filename
6
22
  end
@@ -35,7 +35,10 @@ module Builtins
35
35
 
36
36
  def actions
37
37
  @config["actions"].map do |name, value|
38
- format("%<name>-35s %<desc>s", name: name.yellow, desc: value["description"] || value["command"])
38
+ format("%<name>-35s %<desc>s",
39
+ name: name.yellow,
40
+ desc: value["description"] || value["command"]
41
+ )
39
42
  end
40
43
  end
41
44
  end
@@ -30,7 +30,7 @@ class Environment
30
30
 
31
31
  def set_configured_variables
32
32
  @env_hash.each do |key, value|
33
- ENV[key] = value.to_s
33
+ ENV[key] = `echo #{value}`.chomp
34
34
  end
35
35
  end
36
36
  end
data/lib/ops.rb CHANGED
@@ -49,7 +49,7 @@ class Ops
49
49
 
50
50
  def run_action
51
51
  environment.set_variables
52
- app_config.load
52
+ AppConfig.load
53
53
 
54
54
  return builtin.run if builtin
55
55
 
@@ -106,12 +106,8 @@ class Ops
106
106
  @environment ||= Environment.new(env_vars)
107
107
  end
108
108
 
109
- def app_config_file
110
- `echo #{Options.get("config.path")}`.chomp
111
- end
112
-
113
109
  def app_config
114
- @app_config ||= AppConfig.new(app_config_file)
110
+ @app_config ||= AppConfig.new
115
111
  end
116
112
  end
117
113
 
@@ -8,19 +8,11 @@ require 'options'
8
8
 
9
9
  class Secrets < AppConfig
10
10
  class << self
11
- def load
12
- Secrets.new(secrets_path).load
13
- end
14
-
15
11
  private
16
12
 
17
- def secrets_path
13
+ def app_config_path
18
14
  expand_path(Options.get("secrets.path"))
19
15
  end
20
-
21
- def expand_path(path)
22
- `echo #{path}`.chomp
23
- end
24
16
  end
25
17
 
26
18
  def initialize(filename = "")
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ops_team'
5
- s.version = '0.6.0'
5
+ s.version = '0.7.0'
6
6
  s.authors = [
7
7
  'nickthecook@gmail.com'
8
8
  ]
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.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickthecook@gmail.com