graphite_builder 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/graphite_builder.gemspec +14 -14
- data/lib/graphite_builder.rb +4 -1
- data/test/test_graphite_builder.rb +2 -2
- metadata +13 -13
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/graphite_builder.gemspec
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.
|
7
|
+
s.name = "graphite_builder"
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = [
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
11
|
+
s.authors = ["Edward Muller"]
|
12
|
+
s.date = "2011-11-18"
|
13
|
+
s.description = "A DSL for generating graphite graph urls. Meant to enable copy-and-paste from the graphite UI + simple substitution."
|
14
|
+
s.email = "edward@heroku.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
17
|
"README.rdoc"
|
@@ -29,29 +29,29 @@ Gem::Specification.new do |s|
|
|
29
29
|
"test/helper.rb",
|
30
30
|
"test/test_graphite_builder.rb"
|
31
31
|
]
|
32
|
-
s.homepage =
|
33
|
-
s.licenses = [
|
34
|
-
s.require_paths = [
|
35
|
-
s.rubygems_version =
|
36
|
-
s.summary =
|
32
|
+
s.homepage = "http://github.com/freeformz/graphite_builder"
|
33
|
+
s.licenses = ["MIT"]
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = "1.8.10"
|
36
|
+
s.summary = "A DSL: for generating graphite graph urls."
|
37
37
|
|
38
38
|
if s.respond_to? :specification_version then
|
39
39
|
s.specification_version = 3
|
40
40
|
|
41
41
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
42
42
|
s.add_development_dependency(%q<minitest>, [">= 0"])
|
43
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.
|
43
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.1.rc"])
|
44
44
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
45
45
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
46
46
|
else
|
47
47
|
s.add_dependency(%q<minitest>, [">= 0"])
|
48
|
-
s.add_dependency(%q<bundler>, ["~> 1.
|
48
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.rc"])
|
49
49
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
50
50
|
s.add_dependency(%q<rcov>, [">= 0"])
|
51
51
|
end
|
52
52
|
else
|
53
53
|
s.add_dependency(%q<minitest>, [">= 0"])
|
54
|
-
s.add_dependency(%q<bundler>, ["~> 1.
|
54
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.rc"])
|
55
55
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
56
56
|
s.add_dependency(%q<rcov>, [">= 0"])
|
57
57
|
end
|
data/lib/graphite_builder.rb
CHANGED
@@ -60,7 +60,10 @@ module Graphite
|
|
60
60
|
|
61
61
|
def render
|
62
62
|
raise ::Graphite::Builder::NoTargetsDefined.new if @targets.empty?
|
63
|
-
'<img
|
63
|
+
'<img ' <<
|
64
|
+
(@args.has_key?(:height) ? "height=\"#{@args[:height]}\" " : '') <<
|
65
|
+
(@args.has_key?(:width) ? "width=\"#{@args[:width]}\" " : '') <<
|
66
|
+
'src="' <<
|
64
67
|
@args.delete(:base_url) << '?' <<
|
65
68
|
(@args.map do |k ,v|
|
66
69
|
if v.is_a?(Array)
|
@@ -42,7 +42,7 @@ describe Graphite::Builder do
|
|
42
42
|
width 800
|
43
43
|
height 200
|
44
44
|
target 'a.b.c'
|
45
|
-
end.render.must_equal "<img src=\"http://localhost/render?width=800&height=200&target=a.b.c\"/>"
|
45
|
+
end.render.must_equal "<img height=\"200\" width=\"800\" src=\"http://localhost/render?width=800&height=200&target=a.b.c\"/>"
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -174,7 +174,7 @@ describe Graphite::Builder do
|
|
174
174
|
from '-2hours'
|
175
175
|
target(legend(color(sumSeries("#{hostname}.cpu-*.cpu-steal.value"), :red), 'Steal'))
|
176
176
|
target(legend(color(sumSeries("#{hostname}.cpu-*.cpu-steal.value"), :green), 'Idle'))
|
177
|
-
end.render.must_equal "<img src=\"http://my_graphite.host/render/?width=800&height=200&areaMode=stacked&from=-2hours&target=alias(color(sumSeries(foo.cpu-*.cpu-steal.value),'red'),'Steal')&target=alias(color(sumSeries(foo.cpu-*.cpu-steal.value),'green'),'Idle')\"/>"
|
177
|
+
end.render.must_equal "<img height=\"200\" width=\"800\" src=\"http://my_graphite.host/render/?width=800&height=200&areaMode=stacked&from=-2hours&target=alias(color(sumSeries(foo.cpu-*.cpu-steal.value),'red'),'Steal')&target=alias(color(sumSeries(foo.cpu-*.cpu-steal.value),'green'),'Idle')\"/>"
|
178
178
|
end
|
179
179
|
|
180
180
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphite_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-11-18 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
16
|
-
requirement: &
|
16
|
+
requirement: &70132731132300 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,21 +21,21 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70132731132300
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
27
|
-
requirement: &
|
27
|
+
requirement: &70132731131460 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.
|
32
|
+
version: 1.1.rc
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70132731131460
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jeweler
|
38
|
-
requirement: &
|
38
|
+
requirement: &70132731105220 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.6.4
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70132731105220
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rcov
|
49
|
-
requirement: &
|
49
|
+
requirement: &70132731096200 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70132731096200
|
58
58
|
description: A DSL for generating graphite graph urls. Meant to enable copy-and-paste
|
59
59
|
from the graphite UI + simple substitution.
|
60
60
|
email: edward@heroku.com
|
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
segments:
|
92
92
|
- 0
|
93
|
-
hash: -
|
93
|
+
hash: -854690039685430798
|
94
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
101
|
rubyforge_project:
|
102
|
-
rubygems_version: 1.8.
|
102
|
+
rubygems_version: 1.8.10
|
103
103
|
signing_key:
|
104
104
|
specification_version: 3
|
105
105
|
summary: ! 'A DSL: for generating graphite graph urls.'
|