ops_team 1.11.0.pre.rc3 → 1.12.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: 643d86e6366ca29ee4d7368f9e913c0fad16fe3625e0480287936bb82a794f73
4
- data.tar.gz: 8718e8d67b671d59f7252f0e59cd0aee15dfc1d458bf505609bd5a659330e6bc
3
+ metadata.gz: e4e8d641dd9ba491fb9be7b485203c2fcf22d46b15668b7640b483a6774bbb33
4
+ data.tar.gz: 76089c91d587dbf028ea25b04d62eb5b203303c7680248dd2e27dab377af8880
5
5
  SHA512:
6
- metadata.gz: a5b86e7520a99816668db2fa5e57bb1b5a667f5b486f1d58ad01cc8b3612ec40fee7ee7764f2242fc5b24472d132b9a69bc324a09d050890e69905d309c49191
7
- data.tar.gz: c20a44ba9ec6fdebf3d951513b17d9c7f2fac5e15ff08dd816894c460aa6520801c3de7e15b23187c400072a9c1e347261c63aea39e645df6d0d4de0c9df2a16
6
+ metadata.gz: e35d83233bae11f76df0f961bfc603426255ab5c51cb6f26af64060e87bf0f82dee3f60a20ce3f498b0de4c9d3131cd2b6d28c2520bebe5b53d79289d106a2c9
7
+ data.tar.gz: 4a38de80841fd5ad89b8263f97bb977397ea7915cb6ccdf476c7d73897f96766e5fe61756344ae64c51d0f0b53def9cceae4c2c49913c4d0cbe60ad6f4d32450
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.rb CHANGED
@@ -26,7 +26,13 @@ class Action
26
26
  end
27
27
 
28
28
  def alias
29
- @config["alias"]
29
+ @config["alias"] || @config["aliases"]&.first
30
+ end
31
+
32
+ def aliases
33
+ return [@config["alias"]].compact unless @config["aliases"]
34
+
35
+ ([@config["alias"]] + @config["aliases"]).compact
30
36
  end
31
37
 
32
38
  def command
data/lib/action_list.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'action'
4
+
3
5
  class ActionList
4
6
  class UnknownActionError < StandardError; end
5
7
 
@@ -40,7 +42,16 @@ class ActionList
40
42
  action = Action.new(name, config, @args)
41
43
 
42
44
  @actions[name] = action
43
- @aliases[action.alias] = action
45
+ action.aliases.each do |aliaz|
46
+ check_duplicate_alias(name, aliaz)
47
+ @aliases[aliaz] = action
48
+ end
44
49
  end
45
50
  end
51
+
52
+ def check_duplicate_alias(name, aliaz)
53
+ return if @aliases[aliaz].nil?
54
+
55
+ Output.warn("Duplicate alias '#{aliaz}' detected in action '#{name}'.")
56
+ end
46
57
  end
@@ -23,6 +23,8 @@ module Builtins
23
23
  end
24
24
 
25
25
  Process.detach(subprocess)
26
+
27
+ true
26
28
  end
27
29
 
28
30
  private
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
 
@@ -7,7 +7,7 @@ require 'dependency'
7
7
  module Dependencies
8
8
  class Apk < Dependency
9
9
  def met?
10
- execute("apk info | grep -q #{name}")
10
+ execute("apk info | grep -q '^#{name}'$")
11
11
  end
12
12
 
13
13
  def meet
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.0-rc3'
5
+ s.version = '1.12.0'
6
6
  s.authors = [
7
7
  'nickthecook@gmail.com'
8
8
  ]
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops_team
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0.pre.rc3
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickthecook@gmail.com
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2021-10-25 00:00:00.000000000 Z
@@ -114,22 +114,22 @@ dependencies:
114
114
  name: net-ssh
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- version: 6.1.0
120
117
  - - "~>"
121
118
  - !ruby/object:Gem::Version
122
119
  version: '6.1'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 6.1.0
123
123
  type: :runtime
124
124
  prerelease: false
125
125
  version_requirements: !ruby/object:Gem::Requirement
126
126
  requirements:
127
- - - ">="
128
- - !ruby/object:Gem::Version
129
- version: 6.1.0
130
127
  - - "~>"
131
128
  - !ruby/object:Gem::Version
132
129
  version: '6.1'
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 6.1.0
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: require_all
135
135
  requirement: !ruby/object:Gem::Requirement
@@ -150,8 +150,8 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: 1.1.6
153
- description:
154
- email:
153
+ description:
154
+ email:
155
155
  executables:
156
156
  - ops
157
157
  extensions: []
@@ -213,7 +213,7 @@ homepage: https://github.com/nickthecook/ops
213
213
  licenses:
214
214
  - GPL-3.0-only
215
215
  metadata: {}
216
- post_install_message:
216
+ post_install_message:
217
217
  rdoc_options: []
218
218
  require_paths:
219
219
  - lib
@@ -224,12 +224,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
224
224
  version: '2.5'
225
225
  required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  requirements:
227
- - - ">"
227
+ - - ">="
228
228
  - !ruby/object:Gem::Version
229
- version: 1.3.1
229
+ version: '0'
230
230
  requirements: []
231
- rubygems_version: 3.0.3.1
232
- signing_key:
231
+ rubygems_version: 3.2.15
232
+ signing_key:
233
233
  specification_version: 4
234
234
  summary: ops_team handles basic automation for your project, driven by self-documenting
235
235
  YAML config