| renamed AssetTagHelper to SparklineTagHelper; updated docs - reportable - Fork … | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit 0e966f9804d9bdcbac85e1e0473b697fbb139c43 | |
| parent 811195e44a63b61df0a806e8f53c927a42ea6751 | |
| Author: Marco Otte-Witte <[email protected]> | |
| Date: Thu, 15 Jan 2009 16:54:45 +0100 | |
| renamed AssetTagHelper to SparklineTagHelper; updated docs | |
| Diffstat: | |
| M README.rdoc | 8 ++++++++ | |
| M lib/kvlr/reports_as_sparkline/spar… | 14 ++++++++++---- | |
| D rdoc/classes/Kvlr/ReportsAsSparkli… | 172 ---------------------------… | |
| M rdoc/classes/Kvlr/ReportsAsSparkli… | 12 ++++++------ | |
| M rdoc/classes/Kvlr/ReportsAsSparkli… | 35 +++++++++++++++------------… | |
| A rdoc/classes/Kvlr/ReportsAsSparkli… | 184 +++++++++++++++++++++++++++… | |
| M rdoc/created.rid | 2 +- | |
| M rdoc/files/README_rdoc.html | 23 ++++++++++++++++++++++- | |
| D rdoc/files/lib/kvlr/reports_as_spa… | 102 ---------------------------… | |
| M rdoc/files/lib/kvlr/reports_as_spa… | 2 +- | |
| M rdoc/files/lib/kvlr/reports_as_spa… | 2 +- | |
| A rdoc/files/lib/kvlr/reports_as_spa… | 102 +++++++++++++++++++++++++++… | |
| M rdoc/files/lib/kvlr/reports_as_spa… | 2 +- | |
| M rdoc/fr_class_index.html | 2 +- | |
| M rdoc/fr_file_index.html | 2 +- | |
| M rdoc/fr_method_index.html | 6 +++--- | |
| M spec/other/sparkline_tag_helper_sp… | 18 +++++++++++++++++- | |
| 17 files changed, 375 insertions(+), 313 deletions(-) | |
| --- | |
| diff --git a/README.rdoc b/README.rdoc | |
| @@ -46,6 +46,14 @@ You can than render sparklines for these reports with sparkl… | |
| <%= sparkline_tag(User.registrations_report) %> | |
| +The +sparkline_tag+ helper takes the following parameters: | |
| + | |
| +* width - The width of the generated image | |
| +* height - The height of the generated image | |
| +* line_color - The line color of the sparkline (hex code) | |
| +* fill_color - The color to fill the area below the sparkline with (hex code) | |
| +* labes - The axes to render lables for (Array of :x, :y, :r, :t; this is x ax… | |
| + | |
| == Installation | |
| Installation requires 3 simple steps: | |
| diff --git a/lib/kvlr/reports_as_sparkline/sparkline_tag_helper.rb b/lib/kvlr/r… | |
| @@ -14,15 +14,21 @@ module Kvlr #:nodoc: | |
| # | |
| # * <tt>width</tt> - The width of the generated image | |
| # * <tt>height</tt> - The height of the generated image | |
| - # * <tt>color</tt> - The base color of the generated image (hex code) | |
| + # * <tt>line_color</tt> - The line color of the sparkline (hex code) | |
| + # * <tt>fill_color</tt> - The color to fill the area below the sparkline… | |
| + # * <tt>labes</tt> - The axes to render lables for (Array of :x, :y, :r,… | |
| # | |
| # ==== Example | |
| # <%= sparkline_tag(User.registrations_report, :width => 200, :height =>… | |
| def sparkline_tag(data, options = {}) | |
| - options.reverse_merge!({:width => 300, :height => 34, :color => '0077c… | |
| - data.collect! { |d| d[1] } | |
| + options.reverse_merge!({ :width => 300, :height => 34, :line_color => … | |
| + data = data.collect { |d| d[1] } | |
| + labels = "" | |
| + unless options[:labels].empty? | |
| + labels = "&chxt=#{options[:labels].map(&:to_s).join(',')}&chxr=0,0,#… | |
| + end | |
| image_tag( | |
| - "http://chart.apis.google.com/chart?cht=ls&chs=#{options[:width]}x#{… | |
| + "http://chart.apis.google.com/chart?cht=ls&chs=#{options[:width]}x#{… | |
| ) | |
| end | |
| diff --git a/rdoc/classes/Kvlr/ReportsAsSparkline/AssetTagHelper.html b/rdoc/cl… | |
| @@ -1,171 +0,0 @@ | |
| -<?xml version="1.0" encoding="iso-8859-1"?> | |
| -<!DOCTYPE html | |
| - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
| - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| - | |
| -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| -<head> | |
| - <title>Module: Kvlr::ReportsAsSparkline::AssetTagHelper</title> | |
| - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
| - <meta http-equiv="Content-Script-Type" content="text/javascript" /> | |
| - <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" medi… | |
| - <script type="text/javascript"> | |
| - // <![CDATA[ | |
| - | |
| - function popupCode( url ) { | |
| - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=n… | |
| - } | |
| - | |
| - function toggleCode( id ) { | |
| - if ( document.getElementById ) | |
| - elem = document.getElementById( id ); | |
| - else if ( document.all ) | |
| - elem = eval( "document.all." + id ); | |
| - else | |
| - return false; | |
| - | |
| - elemStyle = elem.style; | |
| - | |
| - if ( elemStyle.display != "block" ) { | |
| - elemStyle.display = "block" | |
| - } else { | |
| - elemStyle.display = "none" | |
| - } | |
| - | |
| - return true; | |
| - } | |
| - | |
| - // Make codeblocks hidden by default | |
| - document.writeln( "<style type=\"text/css\">div.method-source-code { display… | |
| - | |
| - // ]]> | |
| - </script> | |
| - | |
| -</head> | |
| -<body> | |
| - | |
| - | |
| - | |
| - <div id="classHeader"> | |
| - <table class="header-table"> | |
| - <tr class="top-aligned-row"> | |
| - <td><strong>Module</strong></td> | |
| - <td class="class-name-in-header">Kvlr::ReportsAsSparkline::AssetTagH… | |
| - </tr> | |
| - <tr class="top-aligned-row"> | |
| - <td><strong>In:</strong></td> | |
| - <td> | |
| - <a href="../../../files/lib/kvlr/reports_as_sparkline/asset_ta… | |
| - lib/kvlr/reports_as_sparkline/asset_tag_helper.rb | |
| - </a> | |
| - <br /> | |
| - </td> | |
| - </tr> | |
| - | |
| - </table> | |
| - </div> | |
| - <!-- banner header --> | |
| - | |
| - <div id="bodyContent"> | |
| - | |
| - | |
| - | |
| - <div id="contextContent"> | |
| - | |
| - | |
| - | |
| - </div> | |
| - | |
| - <div id="method-list"> | |
| - <h3 class="section-bar">Methods</h3> | |
| - | |
| - <div class="name-list"> | |
| - <a href="#M000002">sparkline_tag</a> | |
| - </div> | |
| - </div> | |
| - | |
| - </div> | |
| - | |
| - | |
| - <!-- if includes --> | |
| - | |
| - <div id="section"> | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - <!-- if method_list --> | |
| - <div id="methods"> | |
| - <h3 class="section-bar">Public Instance methods</h3> | |
| - | |
| - <div id="method-M000002" class="method-detail"> | |
| - <a name="M000002"></a> | |
| - | |
| - <div class="method-heading"> | |
| - <a href="#M000002" class="method-signature"> | |
| - <span class="method-name">sparkline_tag</span><span class="method-ar… | |
| - </a> | |
| - </div> | |
| - | |
| - <div class="method-description"> | |
| - <p> | |
| -Renders a sparkline with the given data. | |
| -</p> | |
| -<h4>Parameters</h4> | |
| -<ul> | |
| -<li><tt>data</tt> - The data to render the sparkline for | |
| - | |
| -</li> | |
| -</ul> | |
| -<h4>Options</h4> | |
| -<ul> | |
| -<li><tt>width</tt> - The width of the generated image | |
| - | |
| -</li> | |
| -<li><tt>height</tt> - The height of the generated image | |
| - | |
| -</li> | |
| -<li><tt>color</tt> - The base color of the generated image (hex code) | |
| - | |
| -</li> | |
| -</ul> | |
| -<h4>Example</h4> | |
| -<p> | |
| -<%= <a | |
| -href="AssetTagHelper.html#M000002">sparkline_tag</a>(User.registrations_report, | |
| -:width => 200, :height => 100, :color => ‘000’) %> | |
| -</p> | |
| - <p><a class="source-toggle" href="#" | |
| - onclick="toggleCode('M000002-source');return false;">[Source]</a><… | |
| - <div class="method-source-code" id="M000002-source"> | |
| -<pre> | |
| - <span class="ruby-comment cmt"># File lib/kvlr/reports_as_sparkline/asset_… | |
| -21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifie… | |
| -22: <span class="ruby-identifier">options</span>.<span class="ruby-ide… | |
| -23: <span class="ruby-identifier">data</span>.<span class="ruby-identi… | |
| -24: <span class="ruby-identifier">image_tag</span>( | |
| -25: <span class="ruby-node">"http://chart.apis.google.com/chart… | |
| -26: ) | |
| -27: <span class="ruby-keyword kw">end</span> | |
| -</pre> | |
| - </div> | |
| - </div> | |
| - </div> | |
| - | |
| - | |
| - </div> | |
| - | |
| - | |
| - </div> | |
| - | |
| - | |
| -<div id="validator-badges"> | |
| - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></sm… | |
| -</div> | |
| - | |
| -</body> | |
| -</html> | |
| -\ No newline at end of file | |
| diff --git a/rdoc/classes/Kvlr/ReportsAsSparkline/ClassMethods.html b/rdoc/clas… | |
| @@ -80,7 +80,7 @@ | |
| <h3 class="section-bar">Methods</h3> | |
| <div class="name-list"> | |
| - <a href="#M000001">reports_as_sparkline</a> | |
| + <a href="#M000002">reports_as_sparkline</a> | |
| </div> | |
| </div> | |
| @@ -102,11 +102,11 @@ | |
| <div id="methods"> | |
| <h3 class="section-bar">Public Instance methods</h3> | |
| - <div id="method-M000001" class="method-detail"> | |
| - <a name="M000001"></a> | |
| + <div id="method-M000002" class="method-detail"> | |
| + <a name="M000002"></a> | |
| <div class="method-heading"> | |
| - <a href="#M000001" class="method-signature"> | |
| + <a href="#M000002" class="method-signature"> | |
| <span class="method-name">reports_as_sparkline</span><span class="me… | |
| </a> | |
| </div> | |
| @@ -164,8 +164,8 @@ records that match there conditions are reported on | |
| end | |
| </pre> | |
| <p><a class="source-toggle" href="#" | |
| - onclick="toggleCode('M000001-source');return false;">[Source]</a><… | |
| - <div class="method-source-code" id="M000001-source"> | |
| + onclick="toggleCode('M000002-source');return false;">[Source]</a><… | |
| + <div class="method-source-code" id="M000002-source"> | |
| <pre> | |
| <span class="ruby-comment cmt"># File lib/kvlr/reports_as_sparkline.rb, li… | |
| 38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifie… | |
| diff --git a/rdoc/classes/Kvlr/ReportsAsSparkline/Report.html b/rdoc/classes/Kv… | |
| @@ -168,12 +168,12 @@ and calculations | |
| <ul> | |
| <li><tt>klass</tt> - The model the report works on (This is the class you | |
| invoke <a | |
| -href="ClassMethods.html#M000001">Kvlr::ReportsAsSparkline::ClassMethods#report… | |
| +href="ClassMethods.html#M000002">Kvlr::ReportsAsSparkline::ClassMethods#report… | |
| on) | |
| </li> | |
| <li><tt>name</tt> - The name of the report (as in <a | |
| -href="ClassMethods.html#M000001">Kvlr::ReportsAsSparkline::ClassMethods#report… | |
| +href="ClassMethods.html#M000002">Kvlr::ReportsAsSparkline::ClassMethods#report… | |
| </li> | |
| </ul> | |
| @@ -218,12 +218,11 @@ records that match there conditions are reported on | |
| 29: <span class="ruby-ivar">@options</span> = { | |
| 30: <span class="ruby-identifier">:limit</span> =<span class="r… | |
| 31: <span class="ruby-identifier">:conditions</span> =<span class="r… | |
| -32: <span class="ruby-identifier">:grouping</span> =<span class="r… | |
| -33: <span class="ruby-identifier">:live_data</span> =<span class="r… | |
| -34: } | |
| -35: <span class="ruby-ivar">@options</span>.<span class="ruby-identifi… | |
| -36: <span class="ruby-ivar">@options</span>.<span class="ruby-identifi… | |
| -37: <span class="ruby-keyword kw">end</span> | |
| +32: <span class="ruby-identifier">:grouping</span> =<span class="r… | |
| +33: } | |
| +34: <span class="ruby-ivar">@options</span>.<span class="ruby-identifi… | |
| +35: <span class="ruby-ivar">@options</span>.<span class="ruby-identifi… | |
| +36: <span class="ruby-keyword kw">end</span> | |
| </pre> | |
| </div> | |
| </div> | |
| @@ -263,16 +262,16 @@ you specify conditions here, caching will be disabled</b>) | |
| onclick="toggleCode('M000010-source');return false;">[Source]</a><… | |
| <div class="method-source-code" id="M000010-source"> | |
| <pre> | |
| - <span class="ruby-comment cmt"># File lib/kvlr/reports_as_sparkline/report… | |
| -45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifie… | |
| -46: <span class="ruby-identifier">ensure_valid_options</span>(<span cl… | |
| -47: <span class="ruby-identifier">custom_conditions</span> = <span cla… | |
| -48: <span class="ruby-identifier">options</span>.<span class="ruby-ide… | |
| -49: <span class="ruby-identifier">options</span>[<span class="ruby-ide… | |
| -50: <span class="ruby-constant">ReportCache</span>.<span class="ruby-i… | |
| -51: <span class="ruby-identifier">read_data</span>(<span class="ruby… | |
| -52: <span class="ruby-keyword kw">end</span> | |
| -53: <span class="ruby-keyword kw">end</span> | |
| + <span class="ruby-comment cmt"># File lib/kvlr/reports_as_sparkline/report… | |
| +44: <span class="ruby-keyword kw">def</span> <span class="ruby-identifie… | |
| +45: <span class="ruby-identifier">ensure_valid_options</span>(<span cl… | |
| +46: <span class="ruby-identifier">custom_conditions</span> = <span cla… | |
| +47: <span class="ruby-identifier">options</span>.<span class="ruby-ide… | |
| +48: <span class="ruby-identifier">options</span>[<span class="ruby-ide… | |
| +49: <span class="ruby-constant">ReportCache</span>.<span class="ruby-i… | |
| +50: <span class="ruby-identifier">read_data</span>(<span class="ruby… | |
| +51: <span class="ruby-keyword kw">end</span> | |
| +52: <span class="ruby-keyword kw">end</span> | |
| </pre> | |
| </div> | |
| </div> | |
| diff --git a/rdoc/classes/Kvlr/ReportsAsSparkline/SparklineTagHelper.html b/rdo… | |
| @@ -0,0 +1,183 @@ | |
| +<?xml version="1.0" encoding="iso-8859-1"?> | |
| +<!DOCTYPE html | |
| + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
| + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| + | |
| +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| +<head> | |
| + <title>Module: Kvlr::ReportsAsSparkline::SparklineTagHelper</title> | |
| + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
| + <meta http-equiv="Content-Script-Type" content="text/javascript" /> | |
| + <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" medi… | |
| + <script type="text/javascript"> | |
| + // <![CDATA[ | |
| + | |
| + function popupCode( url ) { | |
| + window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=n… | |
| + } | |
| + | |
| + function toggleCode( id ) { | |
| + if ( document.getElementById ) | |
| + elem = document.getElementById( id ); | |
| + else if ( document.all ) | |
| + elem = eval( "document.all." + id ); | |
| + else | |
| + return false; | |
| + | |
| + elemStyle = elem.style; | |
| + | |
| + if ( elemStyle.display != "block" ) { | |
| + elemStyle.display = "block" | |
| + } else { | |
| + elemStyle.display = "none" | |
| + } | |
| + | |
| + return true; | |
| + } | |
| + | |
| + // Make codeblocks hidden by default | |
| + document.writeln( "<style type=\"text/css\">div.method-source-code { display… | |
| + | |
| + // ]]> | |
| + </script> | |
| + | |
| +</head> | |
| +<body> | |
| + | |
| + | |
| + | |
| + <div id="classHeader"> | |
| + <table class="header-table"> | |
| + <tr class="top-aligned-row"> | |
| + <td><strong>Module</strong></td> | |
| + <td class="class-name-in-header">Kvlr::ReportsAsSparkline::Sparkline… | |
| + </tr> | |
| + <tr class="top-aligned-row"> | |
| + <td><strong>In:</strong></td> | |
| + <td> | |
| + <a href="../../../files/lib/kvlr/reports_as_sparkline/sparklin… | |
| + lib/kvlr/reports_as_sparkline/sparkline_tag_helper.rb | |
| + </a> | |
| + <br /> | |
| + </td> | |
| + </tr> | |
| + | |
| + </table> | |
| + </div> | |
| + <!-- banner header --> | |
| + | |
| + <div id="bodyContent"> | |
| + | |
| + | |
| + | |
| + <div id="contextContent"> | |
| + | |
| + | |
| + | |
| + </div> | |
| + | |
| + <div id="method-list"> | |
| + <h3 class="section-bar">Methods</h3> | |
| + | |
| + <div class="name-list"> | |
| + <a href="#M000001">sparkline_tag</a> | |
| + </div> | |
| + </div> | |
| + | |
| + </div> | |
| + | |
| + | |
| + <!-- if includes --> | |
| + | |
| + <div id="section"> | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + <!-- if method_list --> | |
| + <div id="methods"> | |
| + <h3 class="section-bar">Public Instance methods</h3> | |
| + | |
| + <div id="method-M000001" class="method-detail"> | |
| + <a name="M000001"></a> | |
| + | |
| + <div class="method-heading"> | |
| + <a href="#M000001" class="method-signature"> | |
| + <span class="method-name">sparkline_tag</span><span class="method-ar… | |
| + </a> | |
| + </div> | |
| + | |
| + <div class="method-description"> | |
| + <p> | |
| +Renders a sparkline with the given data. | |
| +</p> | |
| +<h4>Parameters</h4> | |
| +<ul> | |
| +<li><tt>data</tt> - The data to render the sparkline for | |
| + | |
| +</li> | |
| +</ul> | |
| +<h4>Options</h4> | |
| +<ul> | |
| +<li><tt>width</tt> - The width of the generated image | |
| + | |
| +</li> | |
| +<li><tt>height</tt> - The height of the generated image | |
| + | |
| +</li> | |
| +<li><tt>line_color</tt> - The line color of the sparkline (hex code) | |
| + | |
| +</li> | |
| +<li><tt>fill_color</tt> - The color to fill the area below the sparkline with | |
| +(hex code) | |
| + | |
| +</li> | |
| +<li><tt>labes</tt> - The axes to render lables for (Array of :x, :y, :r, :t; | |
| +this is x axis, y axis, right, top) | |
| + | |
| +</li> | |
| +</ul> | |
| +<h4>Example</h4> | |
| +<p> | |
| +<%= <a | |
| +href="SparklineTagHelper.html#M000001">sparkline_tag</a>(User.registrations_re… | |
| +:width => 200, :height => 100, :color => ‘000’) %> | |
| +</p> | |
| + <p><a class="source-toggle" href="#" | |
| + onclick="toggleCode('M000001-source');return false;">[Source]</a><… | |
| + <div class="method-source-code" id="M000001-source"> | |
| +<pre> | |
| + <span class="ruby-comment cmt"># File lib/kvlr/reports_as_sparkline/sparkl… | |
| +23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifie… | |
| +24: <span class="ruby-identifier">options</span>.<span class="ruby-ide… | |
| +25: <span class="ruby-identifier">data</span> = <span class="ruby-iden… | |
| +26: <span class="ruby-identifier">labels</span> = <span class="ruby-va… | |
| +27: <span class="ruby-keyword kw">unless</span> <span class="ruby-iden… | |
| +28: <span class="ruby-identifier">labels</span> = <span class="ruby-… | |
| +29: <span class="ruby-keyword kw">end</span> | |
| +30: <span class="ruby-identifier">image_tag</span>( | |
| +31: <span class="ruby-node">"http://chart.apis.google.com/chart… | |
| +32: ) | |
| +33: <span class="ruby-keyword kw">end</span> | |
| +</pre> | |
| + </div> | |
| + </div> | |
| + </div> | |
| + | |
| + | |
| + </div> | |
| + | |
| + | |
| + </div> | |
| + | |
| + | |
| +<div id="validator-badges"> | |
| + <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></sm… | |
| +</div> | |
| + | |
| +</body> | |
| +</html> | |
| +\ No newline at end of file | |
| diff --git a/rdoc/created.rid b/rdoc/created.rid | |
| @@ -1 +1 @@ | |
| -Thu, 15 Jan 2009 12:32:28 +0100 | |
| +Thu, 15 Jan 2009 16:53:33 +0100 | |
| diff --git a/rdoc/files/README_rdoc.html b/rdoc/files/README_rdoc.html | |
| @@ -56,7 +56,7 @@ | |
| </tr> | |
| <tr class="top-aligned-row"> | |
| <td><strong>Last Update:</strong></td> | |
| - <td>Thu Jan 15 11:59:48 +0100 2009</td> | |
| + <td>Thu Jan 15 16:53:21 +0100 2009</td> | |
| </tr> | |
| </table> | |
| </div> | |
| @@ -160,6 +160,27 @@ view: | |
| <pre> | |
| <%= sparkline_tag(User.registrations_report) %> | |
| </pre> | |
| +<p> | |
| +The <tt>sparkline_tag</tt> helper takes the following parameters: | |
| +</p> | |
| +<ul> | |
| +<li>width - The width of the generated image | |
| + | |
| +</li> | |
| +<li>height - The height of the generated image | |
| + | |
| +</li> | |
| +<li>line_color - The line color of the sparkline (hex code) | |
| + | |
| +</li> | |
| +<li>fill_color - The color to fill the area below the sparkline with (hex code) | |
| + | |
| +</li> | |
| +<li>labes - The axes to render lables for (Array of :x, :y, :r, :t; this is x | |
| +axis, y axis, right, top) | |
| + | |
| +</li> | |
| +</ul> | |
| <h2>Installation</h2> | |
| <p> | |
| Installation requires 3 simple steps: | |
| diff --git a/rdoc/files/lib/kvlr/reports_as_sparkline/asset_tag_helper_rb.html … | |
| @@ -1,101 +0,0 @@ | |
| -<?xml version="1.0" encoding="iso-8859-1"?> | |
| -<!DOCTYPE html | |
| - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
| - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| - | |
| -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| -<head> | |
| - <title>File: asset_tag_helper.rb</title> | |
| - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
| - <meta http-equiv="Content-Script-Type" content="text/javascript" /> | |
| - <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" m… | |
| - <script type="text/javascript"> | |
| - // <![CDATA[ | |
| - | |
| - function popupCode( url ) { | |
| - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=n… | |
| - } | |
| - | |
| - function toggleCode( id ) { | |
| - if ( document.getElementById ) | |
| - elem = document.getElementById( id ); | |
| - else if ( document.all ) | |
| - elem = eval( "document.all." + id ); | |
| - else | |
| - return false; | |
| - | |
| - elemStyle = elem.style; | |
| - | |
| - if ( elemStyle.display != "block" ) { | |
| - elemStyle.display = "block" | |
| - } else { | |
| - elemStyle.display = "none" | |
| - } | |
| - | |
| - return true; | |
| - } | |
| - | |
| - // Make codeblocks hidden by default | |
| - document.writeln( "<style type=\"text/css\">div.method-source-code { display… | |
| - | |
| - // ]]> | |
| - </script> | |
| - | |
| -</head> | |
| -<body> | |
| - | |
| - | |
| - | |
| - <div id="fileHeader"> | |
| - <h1>asset_tag_helper.rb</h1> | |
| - <table class="header-table"> | |
| - <tr class="top-aligned-row"> | |
| - <td><strong>Path:</strong></td> | |
| - <td>lib/kvlr/reports_as_sparkline/asset_tag_helper.rb | |
| - </td> | |
| - </tr> | |
| - <tr class="top-aligned-row"> | |
| - <td><strong>Last Update:</strong></td> | |
| - <td>Thu Jan 15 11:13:51 +0100 2009</td> | |
| - </tr> | |
| - </table> | |
| - </div> | |
| - <!-- banner header --> | |
| - | |
| - <div id="bodyContent"> | |
| - | |
| - | |
| - | |
| - <div id="contextContent"> | |
| - | |
| - | |
| - | |
| - </div> | |
| - | |
| - | |
| - </div> | |
| - | |
| - | |
| - <!-- if includes --> | |
| - | |
| - <div id="section"> | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - <!-- if method_list --> | |
| - | |
| - | |
| - </div> | |
| - | |
| - | |
| -<div id="validator-badges"> | |
| - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></sm… | |
| -</div> | |
| - | |
| -</body> | |
| -</html> | |
| -\ No newline at end of file | |
| diff --git a/rdoc/files/lib/kvlr/reports_as_sparkline/grouping_rb.html b/rdoc/f… | |
| @@ -56,7 +56,7 @@ | |
| </tr> | |
| <tr class="top-aligned-row"> | |
| <td><strong>Last Update:</strong></td> | |
| - <td>Thu Jan 15 11:13:51 +0100 2009</td> | |
| + <td>Thu Jan 15 15:32:06 +0100 2009</td> | |
| </tr> | |
| </table> | |
| </div> | |
| diff --git a/rdoc/files/lib/kvlr/reports_as_sparkline/report_rb.html b/rdoc/fil… | |
| @@ -56,7 +56,7 @@ | |
| </tr> | |
| <tr class="top-aligned-row"> | |
| <td><strong>Last Update:</strong></td> | |
| - <td>Thu Jan 15 12:32:02 +0100 2009</td> | |
| + <td>Thu Jan 15 15:32:37 +0100 2009</td> | |
| </tr> | |
| </table> | |
| </div> | |
| diff --git a/rdoc/files/lib/kvlr/reports_as_sparkline/sparkline_tag_helper_rb.h… | |
| @@ -0,0 +1,101 @@ | |
| +<?xml version="1.0" encoding="iso-8859-1"?> | |
| +<!DOCTYPE html | |
| + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
| + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| + | |
| +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| +<head> | |
| + <title>File: sparkline_tag_helper.rb</title> | |
| + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
| + <meta http-equiv="Content-Script-Type" content="text/javascript" /> | |
| + <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" m… | |
| + <script type="text/javascript"> | |
| + // <![CDATA[ | |
| + | |
| + function popupCode( url ) { | |
| + window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=n… | |
| + } | |
| + | |
| + function toggleCode( id ) { | |
| + if ( document.getElementById ) | |
| + elem = document.getElementById( id ); | |
| + else if ( document.all ) | |
| + elem = eval( "document.all." + id ); | |
| + else | |
| + return false; | |
| + | |
| + elemStyle = elem.style; | |
| + | |
| + if ( elemStyle.display != "block" ) { | |
| + elemStyle.display = "block" | |
| + } else { | |
| + elemStyle.display = "none" | |
| + } | |
| + | |
| + return true; | |
| + } | |
| + | |
| + // Make codeblocks hidden by default | |
| + document.writeln( "<style type=\"text/css\">div.method-source-code { display… | |
| + | |
| + // ]]> | |
| + </script> | |
| + | |
| +</head> | |
| +<body> | |
| + | |
| + | |
| + | |
| + <div id="fileHeader"> | |
| + <h1>sparkline_tag_helper.rb</h1> | |
| + <table class="header-table"> | |
| + <tr class="top-aligned-row"> | |
| + <td><strong>Path:</strong></td> | |
| + <td>lib/kvlr/reports_as_sparkline/sparkline_tag_helper.rb | |
| + </td> | |
| + </tr> | |
| + <tr class="top-aligned-row"> | |
| + <td><strong>Last Update:</strong></td> | |
| + <td>Thu Jan 15 16:51:29 +0100 2009</td> | |
| + </tr> | |
| + </table> | |
| + </div> | |
| + <!-- banner header --> | |
| + | |
| + <div id="bodyContent"> | |
| + | |
| + | |
| + | |
| + <div id="contextContent"> | |
| + | |
| + | |
| + | |
| + </div> | |
| + | |
| + | |
| + </div> | |
| + | |
| + | |
| + <!-- if includes --> | |
| + | |
| + <div id="section"> | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + <!-- if method_list --> | |
| + | |
| + | |
| + </div> | |
| + | |
| + | |
| +<div id="validator-badges"> | |
| + <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></sm… | |
| +</div> | |
| + | |
| +</body> | |
| +</html> | |
| +\ No newline at end of file | |
| diff --git a/rdoc/files/lib/kvlr/reports_as_sparkline_rb.html b/rdoc/files/lib/… | |
| @@ -56,7 +56,7 @@ | |
| </tr> | |
| <tr class="top-aligned-row"> | |
| <td><strong>Last Update:</strong></td> | |
| - <td>Thu Jan 15 11:13:51 +0100 2009</td> | |
| + <td>Thu Jan 15 15:31:55 +0100 2009</td> | |
| </tr> | |
| </table> | |
| </div> | |
| diff --git a/rdoc/fr_class_index.html b/rdoc/fr_class_index.html | |
| @@ -20,12 +20,12 @@ | |
| <div id="index"> | |
| <h1 class="section-bar">Classes</h1> | |
| <div id="index-entries"> | |
| - <a href="classes/Kvlr/ReportsAsSparkline/AssetTagHelper.html">Kvlr::Report… | |
| <a href="classes/Kvlr/ReportsAsSparkline/ClassMethods.html">Kvlr::ReportsA… | |
| <a href="classes/Kvlr/ReportsAsSparkline/CumulatedReport.html">Kvlr::Repor… | |
| <a href="classes/Kvlr/ReportsAsSparkline/Grouping.html">Kvlr::ReportsAsSpa… | |
| <a href="classes/Kvlr/ReportsAsSparkline/Report.html">Kvlr::ReportsAsSpark… | |
| <a href="classes/Kvlr/ReportsAsSparkline/ReportingPeriod.html">Kvlr::Repor… | |
| + <a href="classes/Kvlr/ReportsAsSparkline/SparklineTagHelper.html">Kvlr::Re… | |
| </div> | |
| </div> | |
| </body> | |
| diff --git a/rdoc/fr_file_index.html b/rdoc/fr_file_index.html | |
| @@ -22,12 +22,12 @@ | |
| <div id="index-entries"> | |
| <a href="files/README_rdoc.html">README.rdoc</a><br /> | |
| <a href="files/lib/kvlr/reports_as_sparkline_rb.html">lib/kvlr/reports_as_… | |
| - <a href="files/lib/kvlr/reports_as_sparkline/asset_tag_helper_rb.html">lib… | |
| <a href="files/lib/kvlr/reports_as_sparkline/cumulated_report_rb.html">lib… | |
| <a href="files/lib/kvlr/reports_as_sparkline/grouping_rb.html">lib/kvlr/re… | |
| <a href="files/lib/kvlr/reports_as_sparkline/report_rb.html">lib/kvlr/repo… | |
| <a href="files/lib/kvlr/reports_as_sparkline/report_cache_rb.html">lib/kvl… | |
| <a href="files/lib/kvlr/reports_as_sparkline/reporting_period_rb.html">lib… | |
| + <a href="files/lib/kvlr/reports_as_sparkline/sparkline_tag_helper_rb.html"… | |
| </div> | |
| </div> | |
| </body> | |
| diff --git a/rdoc/fr_method_index.html b/rdoc/fr_method_index.html | |
| @@ -22,14 +22,14 @@ | |
| <div id="index-entries"> | |
| <a href="classes/Kvlr/ReportsAsSparkline/ReportingPeriod.html#M000007">fir… | |
| <a href="classes/Kvlr/ReportsAsSparkline/Grouping.html#M000005">identifier… | |
| - <a href="classes/Kvlr/ReportsAsSparkline/Grouping.html#M000004">new (Kvlr:… | |
| <a href="classes/Kvlr/ReportsAsSparkline/ReportingPeriod.html#M000006">new… | |
| + <a href="classes/Kvlr/ReportsAsSparkline/Grouping.html#M000004">new (Kvlr:… | |
| <a href="classes/Kvlr/ReportsAsSparkline/Report.html#M000009">new (Kvlr::R… | |
| <a href="classes/Kvlr/ReportsAsSparkline/ReportingPeriod.html#M000008">nex… | |
| - <a href="classes/Kvlr/ReportsAsSparkline/ClassMethods.html#M000001">report… | |
| + <a href="classes/Kvlr/ReportsAsSparkline/ClassMethods.html#M000002">report… | |
| <a href="classes/Kvlr/ReportsAsSparkline/CumulatedReport.html#M000003">run… | |
| <a href="classes/Kvlr/ReportsAsSparkline/Report.html#M000010">run (Kvlr::R… | |
| - <a href="classes/Kvlr/ReportsAsSparkline/AssetTagHelper.html#M000002">spar… | |
| + <a href="classes/Kvlr/ReportsAsSparkline/SparklineTagHelper.html#M000001">… | |
| </div> | |
| </div> | |
| </body> | |
| diff --git a/spec/other/sparkline_tag_helper_spec.rb b/spec/other/sparkline_tag… | |
| @@ -10,12 +10,28 @@ describe Kvlr::ReportsAsSparkline::SparklineTagHelper do | |
| it 'should render an image with the correct source' do | |
| @helper.should_receive(:image_tag).once.with( | |
| - 'http://chart.apis.google.com/chart?cht=ls&chs=300x34&chd=t:1.0,2.0,3.… | |
| + 'http://chart.apis.google.com/chart?cht=ls&chs=300x34&chd=t:1.0,2.0,3.… | |
| ) | |
| @helper.sparkline_tag([[DateTime.now, 1.0], [DateTime.now, 2.0], [DateTi… | |
| end | |
| + it 'should add parameters for labels to the source of the image if renderi… | |
| + @helper.should_receive(:image_tag).once.with( | |
| + 'http://chart.apis.google.com/chart?cht=ls&chs=300x34&chd=t:1.0,2.0,3.… | |
| + ) | |
| + | |
| + @helper.sparkline_tag([[DateTime.now, 1.0], [DateTime.now, 2.0], [DateTi… | |
| + end | |
| + | |
| + it 'should set the parameters for custom colors if custom colors are speci… | |
| + @helper.should_receive(:image_tag).once.with( | |
| + 'http://chart.apis.google.com/chart?cht=ls&chs=300x34&chd=t:1.0,2.0,3.… | |
| + ) | |
| + | |
| + @helper.sparkline_tag([[DateTime.now, 1.0], [DateTime.now, 2.0], [DateTi… | |
| + end | |
| + | |
| end | |
| end |