capistrano-karaf 1.2.4 → 1.2.5
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/lib/capistrano-karaf.rb +10 -8
- metadata +1 -1
data/lib/capistrano-karaf.rb
CHANGED
@@ -118,12 +118,13 @@ def list_bundles ()
|
|
118
118
|
break_listing bundle_line_matcher,data
|
119
119
|
end
|
120
120
|
|
121
|
-
def wait_for_all_bundles (
|
122
|
-
|
121
|
+
def wait_for_all_bundles (args={}, &pred)
|
122
|
+
args = {:timeout => 60, :sleeptime => 1}.merge(args)
|
123
|
+
timeout = Time.now + args[:timeout]
|
123
124
|
|
124
|
-
until Time.now >
|
125
|
+
until Time.now > timeout or list_bundles.all? { |b| pred.call b}
|
125
126
|
puts "Some bundles are still failing the predicate"
|
126
|
-
sleep sleeptime
|
127
|
+
sleep args[:sleeptime]
|
127
128
|
end
|
128
129
|
end
|
129
130
|
|
@@ -132,12 +133,13 @@ def feature_installed? (name)
|
|
132
133
|
feature['status']=='installed' unless feature.nil?
|
133
134
|
end
|
134
135
|
|
135
|
-
def wait_for_bundle (
|
136
|
-
|
136
|
+
def wait_for_bundle (args={}, &pred)
|
137
|
+
args = {:timeout => 60, :sleeptime => 1}.merge(args)
|
138
|
+
timeout = Time.now + args[:timeout]
|
137
139
|
|
138
|
-
while Time.now <
|
140
|
+
while Time.now < timeout and list_bundles.none? { |b| pred.call b}
|
139
141
|
puts "Bundle not yet started"
|
140
|
-
sleep sleeptime
|
142
|
+
sleep args[:sleeptime]
|
141
143
|
end
|
142
144
|
end
|
143
145
|
|