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 CHANGED
@@ -17,3 +17,4 @@ test/version_tmp
17
17
  tmp
18
18
  *.sw*
19
19
  vendor
20
+ *.un~
@@ -1,5 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.0.0
3
4
  - 1.9.3
4
5
  - jruby-18mode # JRuby in 1.8 mode
5
6
  - jruby-19mode # JRuby in 1.9 mode
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
 
@@ -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
- @target = target
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 << ["target", @target.to_s]
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
 
@@ -1,3 +1,3 @@
1
1
  module Slate
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -28,4 +28,5 @@ Gem::Specification.new do |gem|
28
28
  gem.add_development_dependency "webmock"
29
29
  gem.add_development_dependency "guard-rspec"
30
30
  gem.add_development_dependency "rb-fsevent", "~> 0.9"
31
+ gem.add_development_dependency "coveralls", "~> 0.6.3"
31
32
  end
@@ -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
@@ -1,3 +1,6 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+
1
4
  require "slate"
2
5
  require "webmock/rspec"
3
6
  require "mocha_standalone"
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.2
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-03-22 00:00:00.000000000 Z
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: -983316013347641529
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: -983316013347641529
230
+ hash: -4420928061337880336
215
231
  requirements: []
216
232
  rubyforge_project:
217
233
  rubygems_version: 1.8.23