gchart 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 0.4.2 (2008-01-09)
2
+
3
+ * Encoding a flatlined chart doesn't asplode [Jack Danger Canty]
4
+
1
5
  == 0.4.1 (2008-01-02)
2
6
 
3
7
  * (bug #16756 fixed) Example in the README is incorrect
data/README.txt CHANGED
@@ -53,7 +53,7 @@ query parameters using the :extras key, e.g.,
53
53
 
54
54
  (The MIT License)
55
55
 
56
- Copyright 2007 John Barnette (jbarnette@rubyforge.org)
56
+ Copyright 2007-2008 John Barnette (jbarnette@rubyforge.org)
57
57
 
58
58
  Permission is hereby granted, free of charge, to any person obtaining
59
59
  a copy of this software and associated documentation files (the
@@ -44,7 +44,7 @@ module GChart
44
44
  ((((n/max.to_f) * 1000.0).round)/10.0).to_s
45
45
  when :extended
46
46
  return "__" if n.nil?
47
- EXTENDED_PAIRS[((n/max.to_f) * (EXTENDED_PAIRS.size - 1)).round]
47
+ EXTENDED_PAIRS[max.zero? ? 0 : ((n/max.to_f) * (EXTENDED_PAIRS.size - 1)).round]
48
48
  else
49
49
  raise ArgumentError, "unsupported encoding: #{encoding.inspect}"
50
50
  end
@@ -1,3 +1,3 @@
1
1
  module GChart
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -52,6 +52,10 @@ describe GChart, ".encode" do
52
52
  GChart.encode(:text, nil, 1).should == "-1"
53
53
  GChart.encode(:extended, nil, 1).should == "__"
54
54
  end
55
+
56
+ it "encodes 0 with a max of 0 correctly" do
57
+ GChart.encode(:extended, 0, 0).should == "AA"
58
+ end
55
59
  end
56
60
 
57
61
  describe GChart, ".line" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gchart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Barnette
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-01-02 00:00:00 -08:00
12
+ date: 2008-01-09 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency