miga-base 0.6.4.1 → 0.6.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/miga/lair.rb +12 -12
  3. data/lib/miga/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78f28ac4f9aa70580fddfb19051eb941060db8c65f58b708cf38c61a8d94d932
4
- data.tar.gz: 833e26a29e20c51fd1119775073e0124143eb537499ff4ea5653d37125e16ce3
3
+ metadata.gz: 4b861cfbdaa0d9cd28403345bd4dc61c4814a07c09a59709f09415dd05007a60
4
+ data.tar.gz: 4738c33442f61be5a6fe0c6cf36c05cabb4fcd5b08f481099651bdacbc2d97fc
5
5
  SHA512:
6
- metadata.gz: 0fb429f9ead5772092a7c1ff045c1505c14827b2a7727b3b5af102d65ffd29d9428ca50ebc08b0ae62a290704023c579869a5ba5af843a81dab45a33e1e0a357
7
- data.tar.gz: e49a408a11a3101225cb181b9fa56f1d8667888ec362bd3623b43cee4e021a55fd4bfae2e0ab609abc3ed11b6b05136c0f5f15f791767cad5e12e5fb3b27ded8
6
+ metadata.gz: ad69cb41e41f11d5aa0ad38af53a007eac213ab5901df9432d140d510fda2d8b8a7e6f4fda5302709e47c0150030cfdf601c54d9ce308d99aa82deeeb05ed0e8
7
+ data.tar.gz: aba5401cef4cafba7afdf48765ab3690313d768140229fcb297b1d02eba441816fc0f8f69ecfa7e477de6ac0d5387c324e900fb6b20151bd736bfe7814737155
data/lib/miga/lair.rb CHANGED
@@ -94,12 +94,14 @@ class MiGA::Lair < MiGA::MiGA
94
94
  # Searches for MiGA projects recursively in all
95
95
  # subdirectories that are not MiGA projects.
96
96
  def each_project(dir = path)
97
- Dir.entries(dir) do |f|
97
+ Dir.children(dir).each do |f|
98
98
  f = File.join(dir, f)
99
- if MiGA::Project.exists? f
100
- yield(f)
99
+ if MiGA::Project.exist? f
100
+ project = MiGA::Project.load(f)
101
+ raise "Cannot load project: #{f}" if project.nil?
102
+ yield(project)
101
103
  elsif Dir.exists? f
102
- each_project(f) { |p| yield(p) }
104
+ each_project(f) { |project| yield(project) }
103
105
  end
104
106
  end
105
107
  end
@@ -107,21 +109,19 @@ class MiGA::Lair < MiGA::MiGA
107
109
  ##
108
110
  # Traverse directories checking MiGA projects
109
111
  def check_directories
110
- each_project do |dir|
111
- alive = MiGA::Daemon.last_alive(dir)
112
+ each_project do |project|
113
+ alive = MiGA::Daemon.last_alive(project)
112
114
  next if !alive.nil? && alive > Time.now - options[:wait_for]
113
- launch_daemon(dir)
115
+ launch_daemon(project)
114
116
  end
115
117
  end
116
118
 
117
119
  ##
118
- # Launch daemon for the project stored in +dir+
119
- def launch_daemon(dir)
120
- project = MiGA::Project.load(dir)
121
- raise "Cannot load project: #{dir}" if project.nil?
120
+ # Launch daemon for the MiGA::Project +project+
121
+ def launch_daemon(project)
122
+ say "Launching daemon: #{project.path}"
122
123
  d = MiGA::Daemon.new(project, options[:json])
123
124
  d.runopts(:shutdown_when_done, true) unless options[:keep_inactive]
124
- say "Launching daemon: #{dir}"
125
125
  d.daemon(:start, [], false)
126
126
  end
127
127
 
data/lib/miga/version.rb CHANGED
@@ -10,7 +10,7 @@ module MiGA
10
10
  # - Float representing the major.minor version.
11
11
  # - Integer representing gem releases of the current version.
12
12
  # - Integer representing minor changes that require new version number.
13
- VERSION = [0.6, 4, 1]
13
+ VERSION = [0.6, 4, 2]
14
14
 
15
15
  ##
16
16
  # Nickname for the current major.minor version.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miga-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4.1
4
+ version: 0.6.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R