auser-poolparty 1.3.12 → 1.3.13
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/poolparty/cloud.rb +6 -8
- data/test/lib/poolparty/cloud_test.rb +7 -1
- data/test/lib/poolparty/monitor_test.rb +2 -3
- metadata +2 -3
data/VERSION.yml
CHANGED
data/lib/poolparty/cloud.rb
CHANGED
@@ -232,7 +232,7 @@ Compiling cloud #{self.name} to #{tmp_path/"etc"/"#{dependency_resolver_name}"}
|
|
232
232
|
# vote_for(:expand) if v > 0.8
|
233
233
|
# end
|
234
234
|
def monitor(monitor_symbol, &block)
|
235
|
-
monitors[monitor_symbol] ||= PoolParty::Monitor.new(monitor_symbol, &block)
|
235
|
+
monitors[monitor_symbol.to_sym] ||= PoolParty::Monitor.new(monitor_symbol, &block)
|
236
236
|
end
|
237
237
|
|
238
238
|
# Run the monitor logic
|
@@ -250,13 +250,11 @@ Compiling cloud #{self.name} to #{tmp_path/"etc"/"#{dependency_resolver_name}"}
|
|
250
250
|
@monitors ||= {}
|
251
251
|
end
|
252
252
|
|
253
|
-
def monitor_format(mon_name, meth, &block)
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
raise PoolPartyError.create("MonitorsFormattingError", "You created a monitor format for an unknown monitor. Please check and try again!")
|
259
|
-
end
|
253
|
+
def monitor_format(mon_name, meth=nil, &block)
|
254
|
+
if monitors.has_key?(mon_name.to_sym)
|
255
|
+
monitors[mon_name.to_sym].format(meth, &block)
|
256
|
+
else
|
257
|
+
raise PoolPartyError.create("MonitorsFormattingError", "You created a monitor format for an unknown monitor. Please check and try again!")
|
260
258
|
end
|
261
259
|
end
|
262
260
|
|
@@ -158,10 +158,16 @@ class CloudTest < Test::Unit::TestCase
|
|
158
158
|
configure if v < 0.2
|
159
159
|
vote_for(:expand) if v > 1.1
|
160
160
|
end
|
161
|
+
|
161
162
|
monitor :load do |a|
|
162
163
|
# [0.42 0.43 0.37]
|
163
|
-
vote_for(:expand) if a > 0.8
|
164
|
+
vote_for(:expand) if a[0] > 0.8
|
164
165
|
end
|
166
|
+
|
167
|
+
monitor_format :load do |d|
|
168
|
+
d.split(",").map {|ele| ele.to_f }
|
169
|
+
end
|
170
|
+
|
165
171
|
end
|
166
172
|
end
|
167
173
|
|
@@ -48,9 +48,8 @@ class MonitorTest < Test::Unit::TestCase
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
mon.format
|
52
|
-
|
53
|
-
end
|
51
|
+
mon.format {|d|return *d.split(",")}
|
52
|
+
|
54
53
|
assert_equal({:hello => []}, mon.run("hello, world"))
|
55
54
|
assert_equal({:short => []}, mon.run("good day"))
|
56
55
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auser-poolparty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ari Lerner
|
@@ -1114,7 +1114,6 @@ files:
|
|
1114
1114
|
- vendor/gems/trollop/www/index.html
|
1115
1115
|
has_rdoc: false
|
1116
1116
|
homepage: http://poolpartyrb.com
|
1117
|
-
licenses:
|
1118
1117
|
post_install_message:
|
1119
1118
|
rdoc_options:
|
1120
1119
|
- --quiet
|
@@ -1140,7 +1139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1140
1139
|
requirements: []
|
1141
1140
|
|
1142
1141
|
rubyforge_project:
|
1143
|
-
rubygems_version: 1.
|
1142
|
+
rubygems_version: 1.2.0
|
1144
1143
|
signing_key:
|
1145
1144
|
specification_version: 3
|
1146
1145
|
summary: Self-healing, auto-scaling system administration, provisioning and maintaining tool that makes cloud computing easier.
|