ops_team 1.11.1 → 1.11.2

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: bbd461334631b2cd8fb0aa5ab2f917d173edba9c9747ac3267316f6b0d689c0e
4
- data.tar.gz: 98130c35c19e3e6dc934d93d5ffcd6e97c008f37cc4c387a636d1d584cec08ce
3
+ metadata.gz: 6775a19f3c97954027d7ed21ff4433ec76ae9f2102c378f36a6658d55603c196
4
+ data.tar.gz: d9ce7a27cfd7124935c145df548f41f438e599ed89e8464a31c37e997822636a
5
5
  SHA512:
6
- metadata.gz: 8454002c499c4f3bcad73ac5621ba64f4868b32d6498985c69179f31fe894c4901b53b47e6ed2a1bacf9b9aa1418bc819b4a09bbe7d4b266f4d2039f7cb0c8d0
7
- data.tar.gz: b0c2a8e5649e06f48989372726f16db4e6ce5bce263bc9a1ad462724d3f12ecfdf74cb2b794f218060bdc73309c565968d634f045efe4a0ef1cdd41f70d81d25
6
+ metadata.gz: 3feccc3a6ab8205664a041a0216bab8f2e68f36cb2fc8edc8a15371120550afa27994e2ab3c606f164742b1a4e378fda383c42c870acef4549bcde783ae663ba
7
+ data.tar.gz: 3d265366298b75333ae17c10ad65790cd70909bbf2b301d1077d9ec9645f12094c8ecbb3e002074fc0d48db743bbbdb76e2da3172db26da6fc83718077913ce6
data/bin/ops CHANGED
@@ -3,7 +3,6 @@
3
3
 
4
4
  require 'optparse'
5
5
 
6
-
7
6
  def usage
8
7
  puts "Usage: ops [-f|--file <ops_yml>] action [<action args>"
9
8
  puts " ops_yml: the config file to load instead of './ops.yml'"
data/lib/action_list.rb CHANGED
@@ -40,7 +40,16 @@ class ActionList
40
40
  action = Action.new(name, config, @args)
41
41
 
42
42
  @actions[name] = action
43
- @aliases[action.alias] = action
43
+ if action.alias
44
+ check_duplicate_alias(name, action)
45
+ @aliases[action.alias] = action
46
+ end
44
47
  end
45
48
  end
49
+
50
+ def check_duplicate_alias(name, action)
51
+ return if @aliases[action.alias].nil?
52
+
53
+ Output.warn("Duplicate alias '#{action.alias}' detected in action '#{name}'.")
54
+ end
46
55
  end
data/lib/builtins/help.rb CHANGED
@@ -17,23 +17,24 @@ module Builtins
17
17
  end
18
18
 
19
19
  def run
20
- Output.out("Builtins:")
21
- Output.out(" #{builtins.join("\n ")}")
22
- Output.out("")
23
- Output.out("Forwards:")
24
- Output.out(" #{forwards.join("\n ")}")
25
- Output.out("")
26
- Output.out("Actions:")
27
- Output.out(" #{actions.join("\n ")}")
20
+ list("Builtins", builtins) if builtins.any?
21
+ list("Forwards", forwards) if forwards.any?
22
+ list("Actions", actions) if actions.any?
28
23
 
29
24
  true
30
25
  end
31
26
 
32
27
  private
33
28
 
29
+ def list(name, items)
30
+ Output.out("#{name}:")
31
+ Output.out(" #{items.join("\n ")}")
32
+ Output.out("")
33
+ end
34
+
34
35
  def forwards
35
36
  Forwards.new(@config).forwards.map do |name, dir|
36
- format("%<name>-#{NAME_WIDTH}s %<desc>s" , name: name.yellow, desc: "#{dir}")
37
+ format("%<name>-#{NAME_WIDTH}s %<desc>s", name: name.yellow, desc: dir.to_s)
37
38
  end
38
39
  end
39
40
 
data/lib/hook_handler.rb CHANGED
@@ -4,6 +4,7 @@ require 'output'
4
4
 
5
5
  class HookHandler
6
6
  class HookConfigError < StandardError; end
7
+
7
8
  class HookExecError < StandardError; end
8
9
 
9
10
  def initialize(config)
data/lib/ops.rb CHANGED
@@ -101,13 +101,11 @@ class Ops
101
101
  end
102
102
 
103
103
  def config
104
- @config ||= begin
105
- if config_file_exists?
106
- parsed_config_contents
107
- else
108
- Output.warn("File '#{@config_file}' does not exist.") unless @action_name == "init"
109
- {}
110
- end
104
+ @config ||= if config_file_exists?
105
+ parsed_config_contents
106
+ else
107
+ Output.warn("File '#{@config_file}' does not exist.") unless @action_name == "init"
108
+ {}
111
109
  end
112
110
  end
113
111
 
data/lib/secrets.rb CHANGED
@@ -43,9 +43,7 @@ class Secrets < AppConfig
43
43
  end
44
44
 
45
45
  def file_contents
46
- @file_contents ||= begin
47
- @filename.match(/\.ejson$/) ? ejson_contents : super
48
- end
46
+ @file_contents ||= @filename.match(/\.ejson$/) ? ejson_contents : super
49
47
  end
50
48
 
51
49
  def ejson_contents
data/ops_team.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ops_team'
5
- s.version = '1.11.1'
5
+ s.version = '1.11.2'
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: 1.11.1
4
+ version: 1.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickthecook@gmail.com