miga-base 0.7.18.4 → 0.7.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miga/cli/action/lair.rb +12 -5
- data/lib/miga/lair.rb +4 -2
- data/lib/miga/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc5df224531c2f5e902304b478aabe0ba18c02b836c5bab66a675257a3739a08
|
4
|
+
data.tar.gz: 438b9f2cefad3ecc3b65e17f81d5708f6a589c8b34f22b63235cf4123a156922
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 506dd5c19259071abd5cf0a130a70557967833edc520fada73030372d7736f2fe114ce4879bc224e37bcbe407a566bbd3cef39a5bc8ec9669c9c4cd1e63edb74
|
7
|
+
data.tar.gz: 4edb685f9a4adb69339e5ef477d4a0a332da606b402d380e3eab77a055ab94582be3be90f904e9403bc20d3f81c3753ed85df8a43bd9afc3e97b41f88cfd9fb1
|
data/lib/miga/cli/action/lair.rb
CHANGED
@@ -25,6 +25,10 @@ class MiGA::Cli::Action::Lair < MiGA::Cli::Action
|
|
25
25
|
'-p', '--path PATH',
|
26
26
|
'(Mandatory) Path to the directory where the MiGA projects are located'
|
27
27
|
) { |v| cli[:path] = v }
|
28
|
+
opt.on(
|
29
|
+
'--exclude NAME1,NAME2,NAME3', Array,
|
30
|
+
'Exclude these projects (identified by name) from the lair'
|
31
|
+
) { |v| cli[:exclude] = v }
|
28
32
|
opt.on(
|
29
33
|
'--json PATH',
|
30
34
|
'Path to a custom daemon definition in json format'
|
@@ -80,19 +84,22 @@ class MiGA::Cli::Action::Lair < MiGA::Cli::Action
|
|
80
84
|
|
81
85
|
def perform
|
82
86
|
cli.ensure_par(path: '-p')
|
87
|
+
k_opts = %i[
|
88
|
+
json latency wait_for keep_inactive trust_timestamp name dry exclude
|
89
|
+
]
|
90
|
+
opts = Hash[k_opts.map { |k| [k, cli[k]] }]
|
91
|
+
lair = MiGA::Lair.new(cli[:path], opts)
|
92
|
+
|
83
93
|
case cli.operation.to_sym
|
84
94
|
when :terminate
|
85
|
-
|
95
|
+
lair.terminate_daemons
|
86
96
|
when :list
|
87
97
|
o = []
|
88
|
-
|
98
|
+
lair.each_daemon do |d|
|
89
99
|
o << [d.daemon_name, d.class, d.daemon_home, d.active?, d.last_alive]
|
90
100
|
end
|
91
101
|
cli.table(%w[name class path active last_alive], o)
|
92
102
|
else
|
93
|
-
k_opts = %i[json latency wait_for keep_inactive trust_timestamp name dry]
|
94
|
-
opts = Hash[k_opts.map { |k| [k, cli[k]] }]
|
95
|
-
lair = MiGA::Lair.new(cli[:path], opts)
|
96
103
|
lair.daemon(cli.operation, cli[:daemon_opts])
|
97
104
|
end
|
98
105
|
end
|
data/lib/miga/lair.rb
CHANGED
@@ -31,6 +31,7 @@ class MiGA::Lair < MiGA::MiGA
|
|
31
31
|
# by default: true
|
32
32
|
# - dry: Only report when daemons would be launched, but don't actually launch
|
33
33
|
# them
|
34
|
+
# - exclude: Array of project names to be excluded from the lair
|
34
35
|
def initialize(path, opts = {})
|
35
36
|
@path = File.expand_path(path)
|
36
37
|
@options = opts
|
@@ -41,7 +42,8 @@ class MiGA::Lair < MiGA::MiGA
|
|
41
42
|
keep_inactive: false,
|
42
43
|
trust_timestamp: true,
|
43
44
|
name: File.basename(@path),
|
44
|
-
dry: false
|
45
|
+
dry: false,
|
46
|
+
exclude: []
|
45
47
|
}.each { |k, v| @options[k] = v if @options[k].nil? }
|
46
48
|
end
|
47
49
|
|
@@ -109,7 +111,7 @@ class MiGA::Lair < MiGA::MiGA
|
|
109
111
|
project = MiGA::Project.load(f)
|
110
112
|
raise "Cannot load project: #{f}" if project.nil?
|
111
113
|
|
112
|
-
yield(project)
|
114
|
+
yield(project) unless options[:exclude].include?(project.name)
|
113
115
|
elsif Dir.exist? f
|
114
116
|
each_project(f) { |p| yield(p) }
|
115
117
|
end
|
data/lib/miga/version.rb
CHANGED
@@ -8,7 +8,7 @@ module MiGA
|
|
8
8
|
# - Float representing the major.minor version.
|
9
9
|
# - Integer representing gem releases of the current version.
|
10
10
|
# - Integer representing minor changes that require new version number.
|
11
|
-
VERSION = [0.7,
|
11
|
+
VERSION = [0.7, 19, 0]
|
12
12
|
|
13
13
|
##
|
14
14
|
# Nickname for the current major.minor version.
|
@@ -16,7 +16,7 @@ module MiGA
|
|
16
16
|
|
17
17
|
##
|
18
18
|
# Date of the current gem release.
|
19
|
-
VERSION_DATE = Date.new(2021, 1,
|
19
|
+
VERSION_DATE = Date.new(2021, 1, 2)
|
20
20
|
|
21
21
|
##
|
22
22
|
# Reference of MiGA.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miga-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis M. Rodriguez-R
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|