slate 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +1 -0
- data/README.md +2 -0
- data/lib/slate/graph.rb +3 -3
- data/lib/slate/version.rb +1 -1
- data/slate.gemspec +1 -0
- data/spec/lib/slate/graph_spec.rb +7 -0
- data/spec/spec_helper.rb +3 -0
- metadata +20 -4
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Slate
|
2
2
|
[![Build Status](https://secure.travis-ci.org/trobrock/slate.png)](http://travis-ci.org/trobrock/slate)
|
3
3
|
[![Dependency Status](https://gemnasium.com/trobrock/slate.png)](https://gemnasium.com/trobrock/slate)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/trobrock/slate/badge.png?branch=master)](https://coveralls.io/r/trobrock/slate)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/trobrock/slate.png)](https://codeclimate.com/github/trobrock/slate)
|
4
6
|
|
5
7
|
Simple wrapper to the Graphite render api
|
6
8
|
|
data/lib/slate/graph.rb
CHANGED
@@ -23,10 +23,11 @@ module Slate
|
|
23
23
|
@client = client
|
24
24
|
@from = options[:from]
|
25
25
|
@until = options[:until]
|
26
|
+
@targets = options[:targets] || []
|
26
27
|
end
|
27
28
|
|
28
29
|
def <<(target)
|
29
|
-
@
|
30
|
+
@targets << target
|
30
31
|
end
|
31
32
|
|
32
33
|
# Public: Generate a URL to the image of the graph.
|
@@ -55,10 +56,9 @@ module Slate
|
|
55
56
|
|
56
57
|
def url_options
|
57
58
|
options = []
|
58
|
-
options
|
59
|
+
options += @targets.map { |t| ["target", t.to_s] }
|
59
60
|
options << ["from", @from] if @from
|
60
61
|
options << ["until", @until] if @until
|
61
|
-
|
62
62
|
options
|
63
63
|
end
|
64
64
|
|
data/lib/slate/version.rb
CHANGED
data/slate.gemspec
CHANGED
@@ -35,6 +35,13 @@ describe Slate::Graph do
|
|
35
35
|
query(graph.url).should include("target" => "app.server01.load", "format" => "png")
|
36
36
|
end
|
37
37
|
|
38
|
+
it "should be able to get multiple targets" do
|
39
|
+
graph = Slate::Graph.new(@client)
|
40
|
+
graph << Slate::Target.build("app.server01.load")
|
41
|
+
graph << Slate::Target.build("app.server02.load")
|
42
|
+
query(graph.url).should include("target" => ["app.server01.load", "app.server02.load"], "format" => "png")
|
43
|
+
end
|
44
|
+
|
38
45
|
it "should be able to apply functions" do
|
39
46
|
target = Slate::Target.build("app.server01.load") do |t|
|
40
47
|
t.add_function :cumulative
|
data/spec/spec_helper.rb
CHANGED
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: 1.0.
|
4
|
+
version: 1.0.3
|
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: 2013-
|
12
|
+
date: 2013-04-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -155,6 +155,22 @@ dependencies:
|
|
155
155
|
- - ~>
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0.9'
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: coveralls
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ~>
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: 0.6.3
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ~>
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 0.6.3
|
158
174
|
description: Simple api on top of the graphite render api
|
159
175
|
email:
|
160
176
|
- trobrock@gmail.com
|
@@ -202,7 +218,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
218
|
version: '0'
|
203
219
|
segments:
|
204
220
|
- 0
|
205
|
-
hash: -
|
221
|
+
hash: -4420928061337880336
|
206
222
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
223
|
none: false
|
208
224
|
requirements:
|
@@ -211,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
227
|
version: '0'
|
212
228
|
segments:
|
213
229
|
- 0
|
214
|
-
hash: -
|
230
|
+
hash: -4420928061337880336
|
215
231
|
requirements: []
|
216
232
|
rubyforge_project:
|
217
233
|
rubygems_version: 1.8.23
|