googlecharts 0.2.0 → 1.0.0
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.tar.gz.sig +1 -1
- data/History.txt +2 -0
- data/lib/gchart.rb +5 -2
- data/lib/gchart/version.rb +2 -2
- data/spec/gchart_spec.rb +23 -10
- data/website/index.html +1 -1
- metadata +4 -4
- metadata.gz.sig +2 -1
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
^D�C�Ei��k���4����p�1������Tќ��%cha�UnˉN$o�i�Aj��oWq!�e1��-�Y#@�
|
data/History.txt
CHANGED
data/lib/gchart.rb
CHANGED
@@ -101,7 +101,10 @@ class Gchart
|
|
101
101
|
@chart_angle = options[:angle]
|
102
102
|
end
|
103
103
|
end
|
104
|
-
|
104
|
+
|
105
|
+
def self.jstize(string)
|
106
|
+
string.gsub(' ', '+').gsub(/\[|\{|\}|\||\\|\^|\[|\]|\`|\]/) {|c| c[0].to_s(16).upcase}
|
107
|
+
end
|
105
108
|
# load all the custom aliases
|
106
109
|
require 'gchart/aliases'
|
107
110
|
|
@@ -134,7 +137,7 @@ class Gchart
|
|
134
137
|
|
135
138
|
#
|
136
139
|
def jstize(string)
|
137
|
-
|
140
|
+
Gchart.jstize(string)
|
138
141
|
end
|
139
142
|
|
140
143
|
private
|
data/lib/gchart/version.rb
CHANGED
data/spec/gchart_spec.rb
CHANGED
@@ -56,7 +56,7 @@ describe "generating a default Gchart" do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
it "should be able to have muliple set of data with text encoding" do
|
59
|
-
Gchart.line(:data => [[10, 5.2, 4, 45, 78], [20, 40, 70, 15, 99]], :encoding => 'text').include?('chd=t:10,5.2,4,45,78|20,40,70,15,99').should be_true
|
59
|
+
Gchart.line(:data => [[10, 5.2, 4, 45, 78], [20, 40, 70, 15, 99]], :encoding => 'text').include?(Gchart.jstize('chd=t:10,5.2,4,45,78|20,40,70,15,99')).should be_true
|
60
60
|
end
|
61
61
|
|
62
62
|
it "should be able to receive a custom param" do
|
@@ -69,10 +69,10 @@ describe "generating a default Gchart" do
|
|
69
69
|
end
|
70
70
|
|
71
71
|
it "should be able to have axis labels" do
|
72
|
-
Gchart.line(:axis_labels => ['Jan|July|Jan|July|Jan', '0|100', 'A|B|C', '2005|2006|2007']).include?('chxl=0:|Jan|July|Jan|July|Jan|1:|0|100|2:|A|B|C|3:|2005|2006|2007').should be_true
|
73
|
-
Gchart.line(:axis_labels => ['Jan|July|Jan|July|Jan']).include?('chxl=0:|Jan|July|Jan|July|Jan').should be_true
|
74
|
-
Gchart.line(:axis_labels => [['Jan','July','Jan','July','Jan']]).include?('chxl=0:|Jan|July|Jan|July|Jan').should be_true
|
75
|
-
Gchart.line(:axis_labels => [['Jan','July','Jan','July','Jan'], ['0','100'], ['A','B','C'], ['2005','2006','2007']]).include?('chxl=0:|Jan|July|Jan|July|Jan|1:|0|100|2:|A|B|C|3:|2005|2006|2007').should be_true
|
72
|
+
Gchart.line(:axis_labels => ['Jan|July|Jan|July|Jan', '0|100', 'A|B|C', '2005|2006|2007']).include?(Gchart.jstize('chxl=0:|Jan|July|Jan|July|Jan|1:|0|100|2:|A|B|C|3:|2005|2006|2007')).should be_true
|
73
|
+
Gchart.line(:axis_labels => ['Jan|July|Jan|July|Jan']).include?(Gchart.jstize('chxl=0:|Jan|July|Jan|July|Jan')).should be_true
|
74
|
+
Gchart.line(:axis_labels => [['Jan','July','Jan','July','Jan']]).include?(Gchart.jstize('chxl=0:|Jan|July|Jan|July|Jan')).should be_true
|
75
|
+
Gchart.line(:axis_labels => [['Jan','July','Jan','July','Jan'], ['0','100'], ['A','B','C'], ['2005','2006','2007']]).include?(Gchart.jstize('chxl=0:|Jan|July|Jan|July|Jan|1:|0|100|2:|A|B|C|3:|2005|2006|2007')).should be_true
|
76
76
|
end
|
77
77
|
|
78
78
|
end
|
@@ -171,7 +171,7 @@ describe "a line chart" do
|
|
171
171
|
end
|
172
172
|
|
173
173
|
it "should be able to have multiple legends" do
|
174
|
-
@chart.include?("chdl=first+data+set+label|n+data+set+label").should be_true
|
174
|
+
@chart.include?(Gchart.jstize("chdl=first+data+set+label|n+data+set+label")).should be_true
|
175
175
|
end
|
176
176
|
|
177
177
|
it "should be able to have one legend" do
|
@@ -201,12 +201,12 @@ describe "a line chart" do
|
|
201
201
|
it "should be able to set both a graph and a background fill" do
|
202
202
|
Gchart.line(:bg => 'efefef', :graph_bg => '76A4FB').include?("bg,s,efefef").should be_true
|
203
203
|
Gchart.line(:bg => 'efefef', :graph_bg => '76A4FB').include?("c,s,76A4FB").should be_true
|
204
|
-
Gchart.line(:bg => 'efefef', :graph_bg => '76A4FB').include?("chf=c,s,76A4FB|bg,s,efefef").should be_true
|
204
|
+
Gchart.line(:bg => 'efefef', :graph_bg => '76A4FB').include?(Gchart.jstize("chf=c,s,76A4FB|bg,s,efefef")).should be_true
|
205
205
|
end
|
206
206
|
|
207
207
|
it "should be able to have different line colors" do
|
208
|
-
Gchart.line(:line_colors => 'efefef|00ffff').include?('chco=efefef|00ffff').should be_true
|
209
|
-
Gchart.line(:line_color => 'efefef|00ffff').include?('chco=efefef|00ffff').should be_true
|
208
|
+
Gchart.line(:line_colors => 'efefef|00ffff').include?(Gchart.jstize('chco=efefef|00ffff')).should be_true
|
209
|
+
Gchart.line(:line_color => 'efefef|00ffff').include?(Gchart.jstize('chco=efefef|00ffff')).should be_true
|
210
210
|
end
|
211
211
|
|
212
212
|
end
|
@@ -216,7 +216,7 @@ describe "a pie chart" do
|
|
216
216
|
before(:each) do
|
217
217
|
@title = 'Chart Title'
|
218
218
|
@legend = ['first data set label', 'n data set label']
|
219
|
-
@jstized_legend = @legend.join('|')
|
219
|
+
@jstized_legend = Gchart.jstize(@legend.join('|'))
|
220
220
|
@data = [12,8,40,15,5]
|
221
221
|
@chart = Gchart.pie(:title => @title, :legend => @legend, :data => @data)
|
222
222
|
end
|
@@ -261,4 +261,17 @@ describe 'exporting a chart' do
|
|
261
261
|
File.delete('custom_file_name.png') if File.exist?('custom_file_name.png')
|
262
262
|
end
|
263
263
|
|
264
|
+
it "should work even with multiple attrs" do
|
265
|
+
File.delete('foo.png') if File.exist?('foo.png')
|
266
|
+
Gchart.line(:size => '400x200',
|
267
|
+
:data => [1,2,3,4,5],
|
268
|
+
:axis_labels => [[1,2,3,4, 5], %w[foo bar]],
|
269
|
+
:axis_with_labels => 'x,r',
|
270
|
+
:format => "file",
|
271
|
+
:filename => "foo.png"
|
272
|
+
)
|
273
|
+
File.exist?('foo.png').should be_true
|
274
|
+
File.delete('foo.png') if File.exist?('foo.png')
|
275
|
+
end
|
276
|
+
|
264
277
|
end
|
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>Googlecharts</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/googlecharts"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/googlecharts" class="numbers">0.
|
36
|
+
<a href="http://rubyforge.org/projects/googlecharts" class="numbers">1.0.0</a>
|
37
37
|
</div>
|
38
38
|
<h2>→ ‘Sexy Charts using Google <span class="caps">API</span> & Ruby’</h2>
|
39
39
|
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: googlecharts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
platform:
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Aimonetti
|
8
8
|
autorequire:
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
ZR7qHIpykzr3ezcNiWtBWw==
|
31
31
|
-----END CERTIFICATE-----
|
32
32
|
|
33
|
-
date:
|
33
|
+
date: 2008-02-05 00:00:00 -08:00
|
34
34
|
default_executable:
|
35
35
|
dependencies: []
|
36
36
|
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
requirements: []
|
98
98
|
|
99
99
|
rubyforge_project: googlecharts
|
100
|
-
rubygems_version: 0.
|
100
|
+
rubygems_version: 1.0.1
|
101
101
|
signing_key:
|
102
102
|
specification_version: 2
|
103
103
|
summary: description of gem
|
metadata.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
�
|
1
|
+
�
|
2
|
+
�(�(F�VA_�����0�i��"W�1�VZ**��m>vz�_R�ŏ��jނe�(On�u�1������3�1���z{g��Z!��7�[b r��&�E���������Q����PG�9����T�R��)�a@���T����u�I�Pa��"\-Y$f®�Ǭ3"��L���$D�l w���߅���/;���o~h���N.�̄��
|