jparker-ruby-googlechart 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -16,3 +16,7 @@
16
16
 
17
17
  * Gem cleanup (switched from newgem + hoe to echoe)
18
18
  * Fixed data scaling bug with all-zero data
19
+
20
+ == 0.6.2 2008-11-20
21
+
22
+ * Fixed axis label encoding to handle +nil+
@@ -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].collect {|l| CGI::escape(l) }.join('|'))
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ruby-googlechart}
5
- s.version = "0.6.1"
5
+ s.version = "0.6.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["John Parker"]
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jparker-ruby-googlechart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Parker