ops_team 1.11.0 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ops +0 -1
- data/lib/action.rb +7 -1
- data/lib/action_list.rb +12 -1
- data/lib/builtins/background.rb +2 -0
- data/lib/builtins/help.rb +10 -9
- data/lib/builtins/helpers/dependency_handler.rb +1 -1
- data/lib/dependencies/apk.rb +1 -1
- data/lib/dependencies/pip.rb +35 -0
- data/lib/hook_handler.rb +1 -0
- data/lib/ops.rb +5 -7
- data/lib/secrets.rb +1 -3
- data/ops_team.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c5f694faa0c40cbd2f850fe45fb7eb35012d3359bf815e95984198366ddac6d
|
4
|
+
data.tar.gz: 4d9e6178368112d8a55869162b4371ec715a9168bfb9c0b2fca08e0025d7d1e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bf4567b067db9a9041628384e3b09c096b6ece2caada9749c449a29e2e772197e52f5ee8413155e47a8faeb3bc68134f9f4ef86d7aa1f26d4b3111cbe21b0c1
|
7
|
+
data.tar.gz: 59eb6746612f1f7209ea93b086be4556274fbda04d2e7372b2ce8583bc1eea9d86b7a0c795d6d137a6278c3c4a716faa67ee3c69ab2ab1cd155d2b7ec5c097b5
|
data/bin/ops
CHANGED
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
|
-
|
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
|
data/lib/builtins/background.rb
CHANGED
data/lib/builtins/help.rb
CHANGED
@@ -17,23 +17,24 @@ module Builtins
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def run
|
20
|
-
|
21
|
-
|
22
|
-
|
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"
|
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/dependencies/apk.rb
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'English'
|
4
|
+
|
5
|
+
require 'dependency'
|
6
|
+
require 'options'
|
7
|
+
|
8
|
+
module Dependencies
|
9
|
+
class Pip < Dependency
|
10
|
+
DEFAULT_PIP = "python3 -m pip"
|
11
|
+
|
12
|
+
def met?
|
13
|
+
execute("#{pip} show #{name}")
|
14
|
+
end
|
15
|
+
|
16
|
+
def meet
|
17
|
+
execute("#{pip} install #{name}")
|
18
|
+
end
|
19
|
+
|
20
|
+
def unmeet
|
21
|
+
# do nothing; we don't want to uninstall packages and reinstall them every time
|
22
|
+
true
|
23
|
+
end
|
24
|
+
|
25
|
+
def should_meet?
|
26
|
+
true
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def pip
|
32
|
+
Options.get("pip.command") || DEFAULT_PIP
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/hook_handler.rb
CHANGED
data/lib/ops.rb
CHANGED
@@ -101,13 +101,11 @@ class Ops
|
|
101
101
|
end
|
102
102
|
|
103
103
|
def config
|
104
|
-
@config ||=
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
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
data/ops_team.gemspec
CHANGED
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.
|
4
|
+
version: 1.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nickthecook@gmail.com
|
@@ -193,6 +193,7 @@ files:
|
|
193
193
|
- lib/dependencies/docker.rb
|
194
194
|
- lib/dependencies/gem.rb
|
195
195
|
- lib/dependencies/helpers/apt_cache_policy.rb
|
196
|
+
- lib/dependencies/pip.rb
|
196
197
|
- lib/dependencies/sshkey.rb
|
197
198
|
- lib/dependencies/versioned_dependency.rb
|
198
199
|
- lib/dependency.rb
|
@@ -228,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
229
|
- !ruby/object:Gem::Version
|
229
230
|
version: '0'
|
230
231
|
requirements: []
|
231
|
-
rubygems_version: 3.2.
|
232
|
+
rubygems_version: 3.2.15
|
232
233
|
signing_key:
|
233
234
|
specification_version: 4
|
234
235
|
summary: ops_team handles basic automation for your project, driven by self-documenting
|