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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78add7ded2123905f17245092c6133825009a94e16568f98cb476113335aaa93
4
- data.tar.gz: 52599bd611ee57a986b9cc2dc6c360def280b12843b9395ff6eb52e359307366
3
+ metadata.gz: '00009bd6fac219bc943c27592ee2131f110769ef2124697c91b52fcbd123a9a0'
4
+ data.tar.gz: 9f6c85c4019f6ceb777709f42ba6ebb7640039ed3db521ab15b7b4935dcf5cca
5
5
  SHA512:
6
- metadata.gz: 390c1581cacc1a290cb4e165665e00799502fea8315aac6eac43a32e8bc987c2e986bb7550c90bd75c6cef25f87d41b1f4227c087907b182277b5403ef681e84
7
- data.tar.gz: c35a9d8d7e70d9a901ca5686ead93a19182b23b7becce3d5fda3df4069b03bda45ad8869680b2ca54a0b3ac30031ed368a6be1d91d6f830891fa4c3963a4ee5c
6
+ metadata.gz: 165158ff1c590509aa9ae88211996cefcd035faf227d0c88132dc0ea4d3cc4013166b20280627b89d20f6ebcdb2371a537d7f734105118d7d45c1356744c5f62
7
+ data.tar.gz: 73378dff392b26b0da6091e24cba07e66661971469ca7e1ccc0bbdde0eee661ad7dca58a5348228061f649203864e22379a80d96722dc697d69a1e2173839856
@@ -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 actions"
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>-35s %<desc>s", name: name.downcase.to_s.yellow, desc: klass.description)
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>-40s %<desc>s",
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
  )
@@ -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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ops_team'
5
- s.version = '0.19.1'
5
+ s.version = '0.20.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.19.1
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickthecook@gmail.com