rack-sparklines 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -22,11 +22,12 @@ Mix and match your own handlers and cachers with your friends!
22
22
 
23
23
  == Demo
24
24
 
25
- See demo/sparkline_demo.rb
26
- Or http://rack-sparklines.heroku.com/
25
+ See demo/sparkline_demo.rb or http://rack-sparklines.heroku.com/
27
26
 
28
27
  == Codes
29
28
 
29
+ gem install rack-sparklines
30
+
30
31
  http://github.com/technoweenie/rack-sparklines
31
32
 
32
33
  == Copyright
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
@@ -4,7 +4,7 @@ module Rack
4
4
  # Render sparkline graphs dynamically from datapoints in a matching CSV file
5
5
  # (or anything that there is a Handler for).
6
6
  class Sparklines
7
- DEFAULT_SPARK_OPTIONS = {:has_min => true, :has_max => true, 'has_last' => 'true', 'height' => '40', :step => 10, :normalize => 'logarithmic'}
7
+ DEFAULT_SPARK_OPTIONS = {:has_min => true, :has_max => true, :height => 40, :step => 10}
8
8
 
9
9
  # Options:
10
10
  # :spark - Hash of sparkline options. See spark_pr.rb
data/lib/spark_pr.rb CHANGED
@@ -119,7 +119,11 @@ module Spark
119
119
  def Spark.normalize( arr, type = :linear )
120
120
  arr.map!{|v| Math.log(v) } if type == :logarithmic
121
121
  adj, fac = arr.min, arr.max-arr.min
122
- arr.map {|v| (v-adj).quo(fac) rescue 0 }
122
+ arr.map do |v|
123
+ v = (v-adj).quo(fac) rescue 0
124
+ v = 0 if v.respond_to?(:nan?) && v.nan?
125
+ v
126
+ end
123
127
  end
124
128
 
125
129
  def Spark.process_options( options )
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rack-sparklines}
5
- s.version = "1.0.0"
5
+ s.version = "1.1.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["rick"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-sparklines
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rick