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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a0c77da5b4e0cfaee8d470f669d0589f00949c686868780c9c8ee2eb68cd9cd
4
- data.tar.gz: 9f78d665d2559eacc0a19dd16d8b3cd712a512909db8c1a7af1dcb0edd7302d4
3
+ metadata.gz: bc5df224531c2f5e902304b478aabe0ba18c02b836c5bab66a675257a3739a08
4
+ data.tar.gz: 438b9f2cefad3ecc3b65e17f81d5708f6a589c8b34f22b63235cf4123a156922
5
5
  SHA512:
6
- metadata.gz: 0f2ad1f0efb0712fac07ffb62198695be09a27a0f2e3346c97532331973cae21cbede3002c8e0c935945cccdcbbf6027e6297f2621fe8add53f4b47b3fbb2e18
7
- data.tar.gz: 31e5c848db45f20b5a5358b602ee08ad285ba44bb40f20265792a8331067ba51c1cba4e78b6f260264a6bd480d95447e10031005e3b8d18a336ad93f467695c7
6
+ metadata.gz: 506dd5c19259071abd5cf0a130a70557967833edc520fada73030372d7736f2fe114ce4879bc224e37bcbe407a566bbd3cef39a5bc8ec9669c9c4cd1e63edb74
7
+ data.tar.gz: 4edb685f9a4adb69339e5ef477d4a0a332da606b402d380e3eab77a055ab94582be3be90f904e9403bc20d3f81c3753ed85df8a43bd9afc3e97b41f88cfd9fb1
@@ -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
- MiGA::Lair.new(cli[:path]).terminate_daemons
95
+ lair.terminate_daemons
86
96
  when :list
87
97
  o = []
88
- MiGA::Lair.new(cli[:path]).each_daemon do |d|
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
@@ -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
@@ -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, 18, 4]
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, 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.18.4
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-01 00:00:00.000000000 Z
11
+ date: 2021-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons