ops_team 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/lib/builtins/help.rb +9 -25
- data/lib/builtins/helpers/enumerator.rb +31 -0
- data/ops_team.gemspec +3 -3
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0950247f85acd2717010175d13c9e0e11ac5028856322ce4141f8b0e8a41614b'
|
4
|
+
data.tar.gz: a0c2e8ffc12803caa0fcdef133e7bc06b2f180a21310d245ae9a4a6478d4353a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a55cd5bd3d72268e42547669bc5eaaeec94b4d191f9c6af37a71c63f9d6f2bb05dc190c45e4ea83850172529c64a99ca88751a641f6b324c405d6ae309fe548
|
7
|
+
data.tar.gz: 4440dc557457a84ab6b2e32c02cd51c2d842e5ee1b716a00093a5228d58aadf6d23ea608a8e346dbd704eb08c77608d1605fce01775ee4632e3cc32793ce8d6b
|
data/Gemfile
CHANGED
data/lib/builtins/help.rb
CHANGED
@@ -4,10 +4,11 @@ require 'colorize'
|
|
4
4
|
|
5
5
|
require 'builtin'
|
6
6
|
require 'forwards'
|
7
|
+
require 'builtins/helpers/enumerator'
|
7
8
|
|
8
9
|
module Builtins
|
9
10
|
class Help < Builtin
|
10
|
-
NAME_WIDTH =
|
11
|
+
NAME_WIDTH = 40
|
11
12
|
|
12
13
|
class << self
|
13
14
|
def description
|
@@ -35,34 +36,13 @@ module Builtins
|
|
35
36
|
end
|
36
37
|
|
37
38
|
def builtins
|
38
|
-
|
39
|
-
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def builtin_class_map
|
44
|
-
builtin_class_names.each_with_object({}) do |name, hash|
|
45
|
-
# get the class reference for this name
|
46
|
-
constant = const_for(name)
|
47
|
-
# check hash for an existing entry for the same class
|
48
|
-
existing_name = hash[constant]
|
39
|
+
builtin_enumerator.names_by_constant.map do |klass, names|
|
40
|
+
names_string = names.map(&:downcase).map(&:to_s).uniq.join(", ").yellow
|
49
41
|
|
50
|
-
|
51
|
-
# skip adding this one one to avoid duplicates, leaving the shortest name for each class
|
52
|
-
next if existing_name && existing_name.length <= name.length
|
53
|
-
|
54
|
-
hash[constant] = name
|
42
|
+
format("%<names>-#{NAME_WIDTH}s %<desc>s", names: names_string, desc: klass.description)
|
55
43
|
end
|
56
44
|
end
|
57
45
|
|
58
|
-
def builtin_class_names
|
59
|
-
@builtin_class_names ||= Builtins.constants.select { |c| const_for(c).is_a?(Class) }.sort
|
60
|
-
end
|
61
|
-
|
62
|
-
def const_for(name)
|
63
|
-
Builtins.const_get(name, false)
|
64
|
-
end
|
65
|
-
|
66
46
|
def actions
|
67
47
|
return [] unless @config["actions"]
|
68
48
|
|
@@ -79,5 +59,9 @@ module Builtins
|
|
79
59
|
|
80
60
|
""
|
81
61
|
end
|
62
|
+
|
63
|
+
def builtin_enumerator
|
64
|
+
@builtin_enumerator ||= ::Builtins::Helpers::Enumerator
|
65
|
+
end
|
82
66
|
end
|
83
67
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Builtins
|
4
|
+
module Helpers
|
5
|
+
class Enumerator
|
6
|
+
class << self
|
7
|
+
def names_by_constant
|
8
|
+
constants_by_name.each_with_object({}) do |(name, const), hash|
|
9
|
+
if hash.include?(const)
|
10
|
+
hash[const] << name
|
11
|
+
else
|
12
|
+
hash[const] = [name]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def constants_by_name
|
20
|
+
@constants_by_name = Builtins.constants.each_with_object({}) do |const_name, hash|
|
21
|
+
const = Builtins.const_get(const_name, false)
|
22
|
+
|
23
|
+
next unless const.is_a?(Class)
|
24
|
+
|
25
|
+
hash[const_name] = const
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/ops_team.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'ops_team'
|
5
|
-
s.version = '1.
|
5
|
+
s.version = '1.6.0'
|
6
6
|
s.authors = [
|
7
7
|
'nickthecook@gmail.com'
|
8
8
|
]
|
9
9
|
s.date = '2021-05-05'
|
10
|
-
s.summary = 'ops_team handles basic
|
10
|
+
s.summary = 'ops_team handles basic automation for your project, driven by self-documenting YAML config'
|
11
11
|
s.homepage = 'https://github.com/nickthecook/ops'
|
12
12
|
s.files = Dir[
|
13
13
|
'Gemfile',
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
'ops_team.gemspec'
|
23
23
|
]
|
24
24
|
s.executables << 'ops'
|
25
|
-
s.required_ruby_version = '
|
25
|
+
s.required_ruby_version = '> 2.5'
|
26
26
|
s.add_runtime_dependency 'bcrypt_pbkdf', '~> 1.0', '>= 1.0.1'
|
27
27
|
s.add_runtime_dependency 'colorize', '~> 0.8', '>= 0.8.1'
|
28
28
|
s.add_runtime_dependency 'concurrent-ruby', '~> 1.1', '>= 1.1.7'
|
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.
|
4
|
+
version: 1.6.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-05-05 00:00:00.000000000 Z
|
@@ -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: []
|
@@ -179,6 +179,7 @@ files:
|
|
179
179
|
- lib/builtins/exec.rb
|
180
180
|
- lib/builtins/help.rb
|
181
181
|
- lib/builtins/helpers/dependency_handler.rb
|
182
|
+
- lib/builtins/helpers/enumerator.rb
|
182
183
|
- lib/builtins/init.rb
|
183
184
|
- lib/builtins/up.rb
|
184
185
|
- lib/builtins/version.rb
|
@@ -211,13 +212,13 @@ homepage: https://github.com/nickthecook/ops
|
|
211
212
|
licenses:
|
212
213
|
- GPL-3.0-only
|
213
214
|
metadata: {}
|
214
|
-
post_install_message:
|
215
|
+
post_install_message:
|
215
216
|
rdoc_options: []
|
216
217
|
require_paths:
|
217
218
|
- lib
|
218
219
|
required_ruby_version: !ruby/object:Gem::Requirement
|
219
220
|
requirements:
|
220
|
-
- - "
|
221
|
+
- - ">"
|
221
222
|
- !ruby/object:Gem::Version
|
222
223
|
version: '2.5'
|
223
224
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -226,9 +227,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
227
|
- !ruby/object:Gem::Version
|
227
228
|
version: '0'
|
228
229
|
requirements: []
|
229
|
-
rubygems_version: 3.
|
230
|
-
signing_key:
|
230
|
+
rubygems_version: 3.2.15
|
231
|
+
signing_key:
|
231
232
|
specification_version: 4
|
232
|
-
summary: ops_team handles basic
|
233
|
+
summary: ops_team handles basic automation for your project, driven by self-documenting
|
233
234
|
YAML config
|
234
235
|
test_files: []
|