slate 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/slate.rb +1 -0
- data/lib/slate/calculation/last.rb +9 -0
- data/lib/slate/version.rb +1 -1
- data/spec/slate/calculation/last_spec.rb +24 -0
- metadata +7 -4
data/lib/slate.rb
CHANGED
data/lib/slate/version.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe Slate::Calculation::Last do
|
4
|
+
before do
|
5
|
+
@graph = Slate::Graph.new(:target => "some.stat")
|
6
|
+
data = [
|
7
|
+
{
|
8
|
+
"target" => "some.stat",
|
9
|
+
"datapoints" => [
|
10
|
+
[1.0, 1352143990],
|
11
|
+
[0.0, 1352144000],
|
12
|
+
[2.0, 1352145000],
|
13
|
+
[3.0, 1352146000]
|
14
|
+
]
|
15
|
+
}
|
16
|
+
]
|
17
|
+
@graph.stubs(:download).with(:json).returns(JSON.generate(data))
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should calculate the mean of the series" do
|
21
|
+
calculation = Slate::Calculation::Last.new(@graph)
|
22
|
+
calculation.result.should == 3.0
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -122,12 +122,14 @@ files:
|
|
122
122
|
- Rakefile
|
123
123
|
- lib/slate.rb
|
124
124
|
- lib/slate/calculation.rb
|
125
|
+
- lib/slate/calculation/last.rb
|
125
126
|
- lib/slate/calculation/mean.rb
|
126
127
|
- lib/slate/configuration.rb
|
127
128
|
- lib/slate/graph.rb
|
128
129
|
- lib/slate/target.rb
|
129
130
|
- lib/slate/version.rb
|
130
131
|
- slate.gemspec
|
132
|
+
- spec/slate/calculation/last_spec.rb
|
131
133
|
- spec/slate/calculation/mean_spec.rb
|
132
134
|
- spec/slate/graph_spec.rb
|
133
135
|
- spec/slate_spec.rb
|
@@ -146,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
148
|
version: '0'
|
147
149
|
segments:
|
148
150
|
- 0
|
149
|
-
hash:
|
151
|
+
hash: 3107282875806844725
|
150
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
153
|
none: false
|
152
154
|
requirements:
|
@@ -155,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
157
|
version: '0'
|
156
158
|
segments:
|
157
159
|
- 0
|
158
|
-
hash:
|
160
|
+
hash: 3107282875806844725
|
159
161
|
requirements: []
|
160
162
|
rubyforge_project:
|
161
163
|
rubygems_version: 1.8.24
|
@@ -163,6 +165,7 @@ signing_key:
|
|
163
165
|
specification_version: 3
|
164
166
|
summary: Simple wrapper on top of the graphite render api
|
165
167
|
test_files:
|
168
|
+
- spec/slate/calculation/last_spec.rb
|
166
169
|
- spec/slate/calculation/mean_spec.rb
|
167
170
|
- spec/slate/graph_spec.rb
|
168
171
|
- spec/slate_spec.rb
|