sinatra-charter 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/sinatra-charter.rb +12 -4
- data/sinatra-charter-0.1.1.gem +0 -0
- data/sinatra-charter.gemspec +52 -0
- metadata +5 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/sinatra-charter.rb
CHANGED
@@ -15,7 +15,7 @@ module Sinatra
|
|
15
15
|
@chart = params[:chart]
|
16
16
|
end
|
17
17
|
|
18
|
-
if File.exists?
|
18
|
+
if File.exists? chart_full_path
|
19
19
|
chart_url
|
20
20
|
else
|
21
21
|
self.send "render_#{@chart['kind']}_chart"
|
@@ -23,13 +23,21 @@ module Sinatra
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
27
|
-
@
|
26
|
+
def charts_dir
|
27
|
+
@charts_dir ||= "public/charts"
|
28
|
+
end
|
29
|
+
|
30
|
+
def chart_file_name
|
31
|
+
@chart_file_name ||= "#{Digest::MD5.hexdigest @chart.to_s}.png"
|
32
|
+
end
|
33
|
+
|
34
|
+
def chart_full_path
|
35
|
+
@chart_full_path ||= File.join(charts_dir, chart_file_name)
|
28
36
|
end
|
29
37
|
|
30
38
|
def chart_url
|
31
39
|
hostname = /^http:\/\/([\w\.]+).*/.match(request.url)[1]
|
32
|
-
@chart_url ||= {"chart_url" => "http://#{hostname}/charts/#{
|
40
|
+
@chart_url ||= {"chart_url" => "http://#{hostname}/charts/#{chart_file_name}"}.to_json
|
33
41
|
end
|
34
42
|
|
35
43
|
def chart_theme
|
Binary file
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{sinatra-charter}
|
8
|
+
s.version = "0.1.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Lorenzo Planas"]
|
12
|
+
s.date = %q{2010-07-10}
|
13
|
+
s.description = %q{longer description of your gem}
|
14
|
+
s.email = %q{lplanas@qindio.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/sinatra-charter.rb",
|
27
|
+
"sinatra-charter-0.1.1.gem",
|
28
|
+
"sinatra-charter.gemspec",
|
29
|
+
"test/helper.rb",
|
30
|
+
"test/test_sinatra-charter.rb"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://github.com/lplanas/sinatra-charter}
|
33
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = %q{1.3.7}
|
36
|
+
s.summary = %q{Static charts server using Sinatra and Gruff}
|
37
|
+
s.test_files = [
|
38
|
+
"test/helper.rb",
|
39
|
+
"test/test_sinatra-charter.rb"
|
40
|
+
]
|
41
|
+
|
42
|
+
if s.respond_to? :specification_version then
|
43
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
+
else
|
48
|
+
end
|
49
|
+
else
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Lorenzo Planas
|
@@ -18,7 +18,7 @@ date: 2010-07-10 00:00:00 +02:00
|
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
21
|
-
description:
|
21
|
+
description: longer description of your gem
|
22
22
|
email: lplanas@qindio.com
|
23
23
|
executables: []
|
24
24
|
|
@@ -35,6 +35,8 @@ files:
|
|
35
35
|
- Rakefile
|
36
36
|
- VERSION
|
37
37
|
- lib/sinatra-charter.rb
|
38
|
+
- sinatra-charter-0.1.1.gem
|
39
|
+
- sinatra-charter.gemspec
|
38
40
|
- test/helper.rb
|
39
41
|
- test/test_sinatra-charter.rb
|
40
42
|
has_rdoc: true
|