jparker-ruby-googlechart 0.6.1 → 0.6.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/CHANGELOG +4 -0
- data/lib/google_chart/axis.rb +1 -1
- data/ruby-googlechart.gemspec +1 -1
- data/test/google_chart/test_axis.rb +4 -0
- metadata +1 -1
data/CHANGELOG
CHANGED
data/lib/google_chart/axis.rb
CHANGED
@@ -13,7 +13,7 @@ module GoogleChart
|
|
13
13
|
[:x, :y, :r, :t].each do |axis|
|
14
14
|
case axes[axis]
|
15
15
|
when Array
|
16
|
-
@axis_labels << ("#{idx}:|" + axes[axis].
|
16
|
+
@axis_labels << ("#{idx}:|" + axes[axis].map {|l| CGI::escape(l) if l }.join('|'))
|
17
17
|
@axes << axis
|
18
18
|
idx += 1
|
19
19
|
when Range
|
data/ruby-googlechart.gemspec
CHANGED
@@ -48,6 +48,10 @@ class TestAxis < Test::Unit::TestCase
|
|
48
48
|
should 'escape axis labels for url' do
|
49
49
|
assert_match(/\bchxl=0:\|foo\+bar\|baz%7Cfroz\b/, @klass.new(:axes => {:x => ['foo bar', 'baz|froz']}).to_url)
|
50
50
|
end
|
51
|
+
|
52
|
+
should 'convert nil labels to empty strings' do
|
53
|
+
assert_match(/\bchxl=0:\|foo\|\|bar\b/, @klass.new(:axes => {:x => ['foo', nil, 'bar']}).to_url)
|
54
|
+
end
|
51
55
|
end
|
52
56
|
|
53
57
|
context 'axis ranges' do
|