baby-bro 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
data/baby-bro.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{baby-bro}
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bill Doughty"]
@@ -33,7 +33,7 @@ class HashObject
33
33
  return obj
34
34
  elsif matches = key.match( /(\w*)=/ )
35
35
  key = matches[1].to_sym
36
- @hash_obj[key]=*args
36
+ @hash_obj[key]=args.first
37
37
  else
38
38
  raise "No field in Hash object: #{key}" unless @no_exception_on_missing_key
39
39
  end
@@ -98,7 +98,7 @@ module BabyBro
98
98
  # tron "Polling #{project.name}: #{project.directory}"
99
99
  project.log_activity
100
100
  end
101
- sleep @polling_interval
101
+ interruptable_sleep( @polling_interval )do; @continue; end
102
102
  end
103
103
  sleep 5
104
104
  remove_pid_file
@@ -132,5 +132,17 @@ module BabyBro
132
132
  def tron string
133
133
  $stdout.puts if @config && @config.tron
134
134
  end
135
+
136
+ def interruptable_sleep sleep_time, guard_interval=1
137
+ if block_given?
138
+ while( yield && sleep_time > 0 )
139
+ sleep guard_interval
140
+ sleep_time -= guard_interval
141
+ end
142
+ else
143
+ sleep sleep_time
144
+ end
145
+ end
146
+
135
147
  end
136
148
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baby-bro
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bill Doughty