ops_team 0.19.1 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/builtins/help.rb +15 -3
- data/lib/forwards.rb +1 -3
- data/ops_team.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '00009bd6fac219bc943c27592ee2131f110769ef2124697c91b52fcbd123a9a0'
|
4
|
+
data.tar.gz: 9f6c85c4019f6ceb777709f42ba6ebb7640039ed3db521ab15b7b4935dcf5cca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 165158ff1c590509aa9ae88211996cefcd035faf227d0c88132dc0ea4d3cc4013166b20280627b89d20f6ebcdb2371a537d7f734105118d7d45c1356744c5f62
|
7
|
+
data.tar.gz: 73378dff392b26b0da6091e24cba07e66661971469ca7e1ccc0bbdde0eee661ad7dca58a5348228061f649203864e22379a80d96722dc697d69a1e2173839856
|
data/lib/builtins/help.rb
CHANGED
@@ -3,12 +3,15 @@
|
|
3
3
|
require 'colorize'
|
4
4
|
|
5
5
|
require 'builtin'
|
6
|
+
require 'forwards'
|
6
7
|
|
7
8
|
module Builtins
|
8
9
|
class Help < Builtin
|
10
|
+
NAME_WIDTH = 35
|
11
|
+
|
9
12
|
class << self
|
10
13
|
def description
|
11
|
-
"displays available builtins and
|
14
|
+
"displays available builtins, actions, and forwards"
|
12
15
|
end
|
13
16
|
end
|
14
17
|
|
@@ -16,15 +19,24 @@ module Builtins
|
|
16
19
|
Output.out("Builtins:")
|
17
20
|
Output.out(" #{builtins.join("\n ")}")
|
18
21
|
Output.out("")
|
22
|
+
Output.out("Forwards:")
|
23
|
+
Output.out(" #{forwards.join("\n ")}")
|
24
|
+
Output.out("")
|
19
25
|
Output.out("Actions:")
|
20
26
|
Output.out(" #{actions.join("\n ")}")
|
21
27
|
end
|
22
28
|
|
23
29
|
private
|
24
30
|
|
31
|
+
def forwards
|
32
|
+
Forwards.new(@config).forwards.map do |name, dir|
|
33
|
+
format("%<name>-#{NAME_WIDTH}s %<desc>s" , name: name.yellow, desc: "#{dir}")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
25
37
|
def builtins
|
26
38
|
builtin_class_map.map do |klass, name|
|
27
|
-
format("%<name
|
39
|
+
format("%<name>-#{NAME_WIDTH}s %<desc>s", name: name.downcase.to_s.yellow, desc: klass.description)
|
28
40
|
end
|
29
41
|
end
|
30
42
|
|
@@ -55,7 +67,7 @@ module Builtins
|
|
55
67
|
return [] unless @config["actions"]
|
56
68
|
|
57
69
|
@config["actions"].map do |name, action_config|
|
58
|
-
format("%<name
|
70
|
+
format("%<name>-#{NAME_WIDTH}s %<desc>s",
|
59
71
|
name: "#{name.yellow} #{alias_string_for(action_config)}",
|
60
72
|
desc: action_config["description"] || action_config["command"]
|
61
73
|
)
|
data/lib/forwards.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'forward'
|
4
4
|
|
5
5
|
class Forwards
|
6
|
-
def initialize(config, args)
|
6
|
+
def initialize(config, args = [])
|
7
7
|
@config = config
|
8
8
|
@args = args
|
9
9
|
end
|
@@ -12,8 +12,6 @@ class Forwards
|
|
12
12
|
Forward.new(forwards[name], @args) if forwards[name]
|
13
13
|
end
|
14
14
|
|
15
|
-
private
|
16
|
-
|
17
15
|
def forwards
|
18
16
|
@forwards ||= @config["forwards"] || {}
|
19
17
|
end
|
data/ops_team.gemspec
CHANGED