Skip to content
Browse files

initial import of codebase.

  • Loading branch information...
0 parents commit a2daa7df45288f5bc7d70ef7d843080e653a1d7b Derek Perez committed Nov 23, 2009
1 .gitignore
@@ -0,0 +1 @@
+.DS_Store
20 MIT-LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2009 [name of plugin creator]
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
85 README
@@ -0,0 +1,85 @@
+Barcoder, v 1.0
+===============
+
+### Author : Derek Perez
+
+inspired (heavily) by the work of Author: Anuj Luthra. He originally wrote the library barcode_generator (http://github.com/anujluthra/barcode-generator/), that this library is based on.
+
+This library is designed to support streaming barcode information, from GBarcode, straight to the web browser using data urls (http://en.wikipedia.org/wiki/Data_URI_scheme). This is ideal for no-write filesystem scenarios. It also supports persisting the barcodes to disk, but this is an optional function. By default, data urls are used. Barcode generator makes generating/displaying barcodes for certain alphanumeric ids a piece of cake. This way we can generate any barcode type which Gbarcode -> Gnome Barcode project supports.
+
+### FAQ
+
+#### Why did you create this plugin?
+
+barcode_generator is an awesome plugin, however, it does not interact very well with non-write filesystem style servers, ie: Heroku, or EC2. In the cloud, you can't be writing files to the filesystem (usually) directly, so I thought it was necessary to write a plugin that could use data urls (http://en.wikipedia.org/wiki/Data_URI_scheme) to stream the barcode to the browser, __with no filesystem writes whatsoever.__
+
+#### Why didn't you just fork his plugin?
+
+Anuj appeared to not want to rely directly on the RMagick gem itself. Instead, he was calling imagemagick's configure command via Kernel#system. There is nothing wrong with this, but I did not want to add back this dependency if he didn't need/want it. Also, I substantially re-wrote how the plugin generates the barcode with gbarcode.
+
+#### Is your API compatible with barcode_generator?
+
+Yes, it should work identically.
+
+### USAGE:
+its as simple as saying:
+`<%= to_barcode 'FJJ4JD' %> `
+
+This will generate a barcode for FJJ4JD in BARCODE_39 format with default width
+and height and include it in the view.
+
+### Options Options Options:
+To customize your barcodes, you can optionally pass following information in your views
+
+ + encoding_format (Gbarcode constants for eg. Gbarcode::BARCODE_128 etc..)
+ + width
+ + height
+ + scaling_factor
+ + xoff
+ + yoff
+ + margin
+ + no_ascii (accepts boolean true or false, prevents the ascii string from printing at the bottom of the barcode)
+ + output_type (accepts :disk or :stream. :disk will print the image to disk, and serve it regularly.)
+
+in this case your view will look like:
+
+
+ <%= to_barcode 'ANUJ', :height => 100,
+ :width => 400,
+ :margin => 100,
+ :xoff => 20,
+ :yoff => 40
+ %>
+
+
+### Installation:
+First install these requirements:
+
+ 1. gem for gbarcode
+ 2. install native ImageMagick library (and RMagick)
+
+Next, install Barcoder:
+
+`install from git : git://github.com/perezd/barcoder.git`
+
+### Supported Barcode Formats:
+Gbarcode as of now allows us to generate barcodes in following formats:
+ BARCODE_EAN
+ BARCODE_UPC
+ BARCODE_ISBN
+ BARCODE_128B
+ BARCODE_128C
+ BARCODE_128
+ BARCODE_128RAW
+ BARCODE_39
+ BARCODE_I25
+ BARCODE_CBR
+ BARCODE_MSI
+ BARCODE_PLS
+ BARCODE_93
+ BARCODE_ANY
+ BARCODE_NO_CHECKSUM
+
+for more information on Gbarcode visit http://gbarcode.rubyforge.org/rdoc/index.html
+Many many thanks to Anuj Luthra for solving the initial hard work!
+
14 Rakefile
@@ -0,0 +1,14 @@
+require 'rake'
+require 'rake/rdoctask'
+
+desc 'Default: build the docs.'
+task :default => :rdoc
+
+desc 'Generate documentation for the barcoder plugin.'
+Rake::RDocTask.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'Barcoder'
+ rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.rdoc_files.include('README')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
5 init.rb
@@ -0,0 +1,5 @@
+require 'rubygems'
+require 'base64'
+require 'gbarcode'
+require 'rmagick'
+require 'barcoder'
93 lib/barcoder.rb
@@ -0,0 +1,93 @@
+# Barcoder, v.1.0
+# written by: Derek Perez (derek@derekperez.com) 2009
+# inspired (heavily) by the work of Author: Anuj Luthra. He originally wrote the library
+# barcode_generator (http://github.com/anujluthra/barcode-generator/), that this library is
+# based on.
+#
+# This library is designed to support streaming barcode information, from GBarcode,
+# straight to the web browser using data urls (http://en.wikipedia.org/wiki/Data_URI_scheme).
+# This is ideal for no-write filesystem scenarios. It also supports persisting the barcodes
+# to disk, but this is an optional function. By default, data urls are used.
+module ActionView
+ class Base
+
+ # important defaults, should not be messed with.
+ VALID_BARCODER_OPTIONS = [:encoding_format, :output_format, :width, :height, :scaling_factor, :xoff, :yoff, :margin, :output_type]
+ DEFAULT_BARCODER_OUTPUT_FORMAT = 'gif'
+ DEFAULT_BARCODER_ENCODING = Gbarcode::BARCODE_39 | Gbarcode::BARCODE_NO_CHECKSUM
+ BARCODE_STORAGE_PATH = "public/images/barcodes"
+
+
+ def to_barcode(str, options = {:encoding_format => DEFAULT_BARCODER_ENCODING })
+ # verify requirements
+ options.assert_valid_keys(VALID_BARCODER_OPTIONS)
+ output_format = options[:output_format] ? options[:output_format] : DEFAULT_BARCODER_OUTPUT_FORMAT
+ output_type = options[:output_type] ? options[:output_type] : :stream
+ # generate the barcode object with all supplied options
+ options[:encoding_format] = DEFAULT_BARCODER_ENCODING unless options[:encoding_format]
+ bc = Gbarcode.barcode_create(str.to_s)
+
+ bc.width = options[:width] if options[:width]
+ bc.height = options[:height] if options[:height]
+ bc.scalef = options[:scaling_factor] if options[:scaling_factor]
+ bc.xoff = options[:xoff] if options[:xoff]
+ bc.yoff = options[:yoff] if options[:yoff]
+ bc.margin = options[:margin] if options[:margin]
+
+ Gbarcode.barcode_encode(bc, options[:encoding_format])
+
+ if options[:no_ascii]
+ print_options = Gbarcode::BARCODE_OUT_EPS|Gbarcode::BARCODE_NO_ASCII
+ else
+ print_options = Gbarcode::BARCODE_OUT_EPS
+ end
+
+ # this is where the magic happens.
+ stream = get_bytes_from_barcode(bc, print_options)
+ data = Magick::Image::read_inline(Base64.encode64(stream))[0]
+ data.format = output_format
+
+ # simple output strategy, define :output_type => :disk in the #to_barcode call if you want
+ # it to write out to the disk for you, otherwise it will be a data url stream.
+ output_type == :disk ? barcode_to_disk(data, bc, output_format) : barcode_to_stream(data)
+ end
+
+ # support for the original barcode-generator plugin syntax.
+ def barcode(str, options = {:encoding_format => DEFAULT_BARCODER_ENCODING })
+ to_barcode(str, options)
+ end
+
+ protected
+
+ # stream the barcode to disk. this may be necessary for some cases, but if you
+ # are living on a cluster node like say, heroku, this won't work out well for you.
+ def barcode_to_disk(data, barcode, output_format)
+ filename = "#{barcode.ascii.gsub(" ", "-")}.#{output_format}"
+ Dir.mkdir(BARCODE_STORAGE_PATH) unless File.directory?(BARCODE_STORAGE_PATH)
+ File.open("#{BARCODE_STORAGE_PATH}/#{filename}", 'w') do |f|
+ f.write(data.to_blob)
+ end
+ image_tag("barcodes/#{filename}")
+ end
+
+ # stream the barcode to the client as a data url. often times, the barcode
+ # filesize is so minute, that this is absolutely acceptable. NOTE: I intentionally
+ # draw my own img tag for this, image_tag doesn't really like this.
+ def barcode_to_stream(data)
+ src = "data:image/#{data.format};base64,#{Base64.encode64(data.to_blob)}"
+ %Q{<img src="#{src}" />}
+ end
+
+ # this method tricks GBarcode into printing the contents of the EPS into
+ # a file pipe, allowing us to get at the binary data, without touching the disk.
+ def get_bytes_from_barcode(barcode, print_options)
+ read, write = File.pipe
+ Gbarcode.barcode_print(barcode, write, print_options)
+ write.close
+ buffer = read.readlines.join("\n")
+ read.close
+ return buffer
+ end
+
+ end
+end
129 rdoc/classes/ActionView.html
@@ -0,0 +1,129 @@
+<?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: ActionView</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" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ 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: none }</style>" )
+
+ // ]]>
+ </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">ActionView</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../files/lib/barcoder_rb.html">
+ lib/barcoder.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+Barcoder, v.1.0 written by: Derek Perez (derek@derekperez.com) 2009
+inspired (heavily) by the work of Author: Anuj Luthra. He originally wrote
+the library barcode_generator (<a
+href="http://github.com/anujluthra/barcode-generator">github.com/anujluthra/barcode-generator</a>/),
+that this library is based on.
+</p>
+<p>
+This library is designed to support streaming barcode information, from
+GBarcode, straight to the web browser using data urls (<a
+href="http://en.wikipedia.org/wiki/Data_URI_scheme">en.wikipedia.org/wiki/Data_URI_scheme</a>).
+This is ideal for no-write filesystem scenarios. It also supports
+persisting the barcodes to disk, but this is an optional function. By
+default, data urls are used.
+</p>
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+ <div id="class-list">
+ <h3 class="section-bar">Classes and Modules</h3>
+
+ Class <a href="ActionView/Base.html" class="link">ActionView::Base</a><br />
+
+ </div>
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
338 rdoc/classes/ActionView/Base.html
@@ -0,0 +1,338 @@
+<?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>Class: ActionView::Base</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" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ 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: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Class</strong></td>
+ <td class="class-name-in-header">ActionView::Base</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../../files/lib/barcoder_rb.html">
+ lib/barcoder.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ <tr class="top-aligned-row">
+ <td><strong>Parent:</strong></td>
+ <td>
+ Object
+ </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">barcode</a>&nbsp;&nbsp;
+ <a href="#M000003">barcode_to_disk</a>&nbsp;&nbsp;
+ <a href="#M000004">barcode_to_stream</a>&nbsp;&nbsp;
+ <a href="#M000005">get_bytes_from_barcode</a>&nbsp;&nbsp;
+ <a href="#M000001">to_barcode</a>&nbsp;&nbsp;
+ </div>
+ </div>
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+ <div id="constants-list">
+ <h3 class="section-bar">Constants</h3>
+
+ <div class="name-list">
+ <table summary="Constants">
+ <tr class="top-aligned-row context-row">
+ <td class="context-item-name">VALID_BARCODER_OPTIONS</td>
+ <td>=</td>
+ <td class="context-item-value">[:encoding_format, :output_format, :width, :height, :scaling_factor, :xoff, :yoff, :margin, :output_type]</td>
+ <td width="3em">&nbsp;</td>
+ <td class="context-item-desc">
+important defaults, should not be messed with.
+
+</td>
+ </tr>
+ <tr class="top-aligned-row context-row">
+ <td class="context-item-name">DEFAULT_BARCODER_OUTPUT_FORMAT</td>
+ <td>=</td>
+ <td class="context-item-value">'gif'</td>
+ </tr>
+ <tr class="top-aligned-row context-row">
+ <td class="context-item-name">DEFAULT_BARCODER_ENCODING</td>
+ <td>=</td>
+ <td class="context-item-value">Gbarcode::BARCODE_39 | Gbarcode::BARCODE_NO_CHECKSUM</td>
+ </tr>
+ <tr class="top-aligned-row context-row">
+ <td class="context-item-name">BARCODE_STORAGE_PATH</td>
+ <td>=</td>
+ <td class="context-item-value">&quot;public/images/barcodes&quot;</td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+
+
+
+
+
+ <!-- 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">barcode</span><span class="method-args">(str, options = {:encoding_format =&gt; DEFAULT_BARCODER_ENCODING })</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+support for the original <a href="Base.html#M000002">barcode</a>-generator
+plugin syntax.
+</p>
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000002-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/barcoder.rb, line 56</span>
+56: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">barcode</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">options</span> = {<span class="ruby-identifier">:encoding_format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">DEFAULT_BARCODER_ENCODING</span> })
+57: <span class="ruby-identifier">to_barcode</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">options</span>)
+58: <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+ <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">to_barcode</span><span class="method-args">(str, options = {:encoding_format =&gt; DEFAULT_BARCODER_ENCODING })</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000001-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/barcoder.rb, line 21</span>
+21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_barcode</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">options</span> = {<span class="ruby-identifier">:encoding_format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">DEFAULT_BARCODER_ENCODING</span> })
+22: <span class="ruby-comment cmt"># verify requirements</span>
+23: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">assert_valid_keys</span>(<span class="ruby-constant">VALID_BARCODER_OPTIONS</span>)
+24: <span class="ruby-identifier">output_format</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:output_format</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:output_format</span>] <span class="ruby-operator">:</span> <span class="ruby-constant">DEFAULT_BARCODER_OUTPUT_FORMAT</span>
+25: <span class="ruby-identifier">output_type</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:output_type</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:output_type</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">:stream</span>
+26: <span class="ruby-comment cmt"># generate the barcode object with all supplied options</span>
+27: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:encoding_format</span>] = <span class="ruby-constant">DEFAULT_BARCODER_ENCODING</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:encoding_format</span>]
+28: <span class="ruby-identifier">bc</span> = <span class="ruby-constant">Gbarcode</span>.<span class="ruby-identifier">barcode_create</span>(<span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_s</span>)
+29:
+30: <span class="ruby-identifier">bc</span>.<span class="ruby-identifier">width</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:width</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:width</span>]
+31: <span class="ruby-identifier">bc</span>.<span class="ruby-identifier">height</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:height</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:height</span>]
+32: <span class="ruby-identifier">bc</span>.<span class="ruby-identifier">scalef</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:scaling_factor</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:scaling_factor</span>]
+33: <span class="ruby-identifier">bc</span>.<span class="ruby-identifier">xoff</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:xoff</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:xoff</span>]
+34: <span class="ruby-identifier">bc</span>.<span class="ruby-identifier">yoff</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:yoff</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:yoff</span>]
+35: <span class="ruby-identifier">bc</span>.<span class="ruby-identifier">margin</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:margin</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:margin</span>]
+36:
+37: <span class="ruby-constant">Gbarcode</span>.<span class="ruby-identifier">barcode_encode</span>(<span class="ruby-identifier">bc</span>, <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:encoding_format</span>])
+38:
+39: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:no_ascii</span>]
+40: <span class="ruby-identifier">print_options</span> = <span class="ruby-constant">Gbarcode</span><span class="ruby-operator">::</span><span class="ruby-constant">BARCODE_OUT_EPS</span><span class="ruby-operator">|</span><span class="ruby-constant">Gbarcode</span><span class="ruby-operator">::</span><span class="ruby-constant">BARCODE_NO_ASCII</span>
+41: <span class="ruby-keyword kw">else</span>
+42: <span class="ruby-identifier">print_options</span> = <span class="ruby-constant">Gbarcode</span><span class="ruby-operator">::</span><span class="ruby-constant">BARCODE_OUT_EPS</span>
+43: <span class="ruby-keyword kw">end</span>
+44:
+45: <span class="ruby-comment cmt"># this is where the magic happens.</span>
+46: <span class="ruby-identifier">stream</span> = <span class="ruby-identifier">get_bytes_from_barcode</span>(<span class="ruby-identifier">bc</span>, <span class="ruby-identifier">print_options</span>)
+47: <span class="ruby-identifier">data</span> = <span class="ruby-constant">Magick</span><span class="ruby-operator">::</span><span class="ruby-constant">Image</span><span class="ruby-operator">::</span><span class="ruby-identifier">read_inline</span>(<span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-identifier">stream</span>))[<span class="ruby-value">0</span>]
+48: <span class="ruby-identifier">data</span>.<span class="ruby-identifier">format</span> = <span class="ruby-identifier">output_format</span>
+49:
+50: <span class="ruby-comment cmt"># simple output strategy, define :output_type =&gt; :disk in the #to_barcode call if you want</span>
+51: <span class="ruby-comment cmt"># it to write out to the disk for you, otherwise it will be a data url stream.</span>
+52: <span class="ruby-identifier">output_type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:disk</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">barcode_to_disk</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">bc</span>, <span class="ruby-identifier">output_format</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">barcode_to_stream</span>(<span class="ruby-identifier">data</span>)
+53: <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+ <h3 class="section-bar">Protected Instance methods</h3>
+
+ <div id="method-M000003" class="method-detail">
+ <a name="M000003"></a>
+
+ <div class="method-heading">
+ <a href="#M000003" class="method-signature">
+ <span class="method-name">barcode_to_disk</span><span class="method-args">(data, barcode, output_format)</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+stream the <a href="Base.html#M000002">barcode</a> to disk. this may be
+necessary for some cases, but if you are living on a cluster node like say,
+heroku, this won&#8216;t work out well for you.
+</p>
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000003-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/barcoder.rb, line 64</span>
+64: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">barcode_to_disk</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">barcode</span>, <span class="ruby-identifier">output_format</span>)
+65: <span class="ruby-identifier">filename</span> = <span class="ruby-node">&quot;#{barcode.ascii.gsub(&quot; &quot;, &quot;-&quot;)}.#{output_format}&quot;</span>
+66: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span>(<span class="ruby-constant">BARCODE_STORAGE_PATH</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-constant">BARCODE_STORAGE_PATH</span>)
+67: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-node">&quot;#{BARCODE_STORAGE_PATH}/#{filename}&quot;</span>, <span class="ruby-value str">'w'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
+68: <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>.<span class="ruby-identifier">to_blob</span>)
+69: <span class="ruby-keyword kw">end</span>
+70: <span class="ruby-identifier">image_tag</span>(<span class="ruby-node">&quot;barcodes/#{filename}&quot;</span>)
+71: <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+ <div id="method-M000004" class="method-detail">
+ <a name="M000004"></a>
+
+ <div class="method-heading">
+ <a href="#M000004" class="method-signature">
+ <span class="method-name">barcode_to_stream</span><span class="method-args">(data)</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+stream the <a href="Base.html#M000002">barcode</a> to the client as a data
+url. often times, the <a href="Base.html#M000002">barcode</a> filesize is
+so minute, that this is absolutely acceptable. NOTE: I intentionally draw
+my own img tag for this, image_tag doesn&#8216;t really like this.
+</p>
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000004-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/barcoder.rb, line 76</span>
+76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">barcode_to_stream</span>(<span class="ruby-identifier">data</span>)
+77: <span class="ruby-identifier">src</span> = <span class="ruby-node">&quot;data:image/#{data.format};base64,#{Base64.encode64(data.to_blob)}&quot;</span>
+78: <span class="ruby-node">%Q{&lt;img src=&quot;#{src}&quot; /&gt;}</span>
+79: <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+ <div id="method-M000005" class="method-detail">
+ <a name="M000005"></a>
+
+ <div class="method-heading">
+ <a href="#M000005" class="method-signature">
+ <span class="method-name">get_bytes_from_barcode</span><span class="method-args">(barcode, print_options)</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+this method tricks GBarcode into printing the contents of the EPS into a
+file pipe, allowing us to get at the binary data, without touching the
+disk.
+</p>
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000005-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/barcoder.rb, line 83</span>
+83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_bytes_from_barcode</span>(<span class="ruby-identifier">barcode</span>, <span class="ruby-identifier">print_options</span>)
+84: <span class="ruby-identifier">read</span>, <span class="ruby-identifier">write</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">pipe</span>
+85: <span class="ruby-constant">Gbarcode</span>.<span class="ruby-identifier">barcode_print</span>(<span class="ruby-identifier">barcode</span>, <span class="ruby-identifier">write</span>, <span class="ruby-identifier">print_options</span>)
+86: <span class="ruby-identifier">write</span>.<span class="ruby-identifier">close</span>
+87: <span class="ruby-identifier">buffer</span> = <span class="ruby-identifier">read</span>.<span class="ruby-identifier">readlines</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
+88: <span class="ruby-identifier">read</span>.<span class="ruby-identifier">close</span>
+89: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">buffer</span>
+90: <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></small></p>
+</div>
+
+</body>
+</html>
1 rdoc/created.rid
@@ -0,0 +1 @@
+Mon, 23 Nov 2009 00:22:15 -0800
233 rdoc/files/README.html
@@ -0,0 +1,233 @@
+<?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: README</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" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ 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: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>README</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>README
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Mon Nov 23 00:20:30 -0800 2009</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+Barcoder, v 1.0
+</p>
+<h6>=========</h6>
+<p>
+### Author : Derek Perez
+</p>
+<p>
+inspired (heavily) by the work of Author: Anuj Luthra. He originally wrote
+the library barcode_generator (<a
+href="http://github.com/anujluthra/barcode-generator">github.com/anujluthra/barcode-generator</a>/),
+that this library is based on.
+</p>
+<p>
+This library is designed to support streaming barcode information, from
+GBarcode, straight to the web browser using data urls (<a
+href="http://en.wikipedia.org/wiki/Data_URI_scheme">en.wikipedia.org/wiki/Data_URI_scheme</a>).
+This is ideal for no-write filesystem scenarios. It also supports
+persisting the barcodes to disk, but this is an optional function. By
+default, data urls are used. Barcode generator makes generating/displaying
+barcodes for certain alphanumeric ids a piece of cake. This way we can
+generate any barcode type which Gbarcode -&gt; Gnome Barcode project
+supports.
+</p>
+<p>
+### FAQ
+</p>
+<p>
+#### Why did you create this plugin?
+</p>
+<p>
+barcode_generator is an awesome plugin, however, it does not interact very
+well with non-write filesystem style servers, ie: Heroku, or EC2. In the
+cloud, you can&#8216;t be writing files to the filesystem (usually)
+directly, so I thought it was necessary to write a plugin that could use
+data urls (<a
+href="http://en.wikipedia.org/wiki/Data_URI_scheme">en.wikipedia.org/wiki/Data_URI_scheme</a>)
+to stream the barcode to the browser, __with no filesystem writes
+whatsoever.__
+</p>
+<p>
+#### Why didn&#8216;t you just fork his plugin?
+</p>
+<p>
+Anuj appeared to not want to rely directly on the RMagick gem itself.
+Instead, he was calling imagemagick&#8216;s configure command via
+Kernel#system. There is nothing wrong with this, but I did not want to add
+back this dependency if he didn&#8216;t need/want it. Also, I substantially
+re-wrote how the plugin generates the barcode with gbarcode.
+</p>
+<p>
+#### Is your API compatible with barcode_generator?
+</p>
+<p>
+Yes, it should work identically.
+</p>
+<p>
+### USAGE: its as simple as saying: `&lt;%= to_barcode &#8216;FJJ4JD&#8217;
+%&gt; `
+</p>
+<p>
+This will generate a barcode for FJJ4JD in BARCODE_39 format with default
+width and height and include it in the view.
+</p>
+<p>
+### Options Options Options: To customize your barcodes, you can optionally
+pass following information in your views
+</p>
+<pre>
+ + encoding_format (Gbarcode constants for eg. Gbarcode::BARCODE_128 etc..)
+ + width
+ + height
+ + scaling_factor
+ + xoff
+ + yoff
+ + margin
+ + no_ascii (accepts boolean true or false, prevents the ascii string from printing at the bottom of the barcode)
+ + output_type (accepts :disk or :stream. :disk will print the image to disk, and serve it regularly.)
+</pre>
+<p>
+in this case your view will look like:
+</p>
+<pre>
+ &lt;%= to_barcode 'ANUJ', :height =&gt; 100,
+ :width =&gt; 400,
+ :margin =&gt; 100,
+ :xoff =&gt; 20,
+ :yoff =&gt; 40
+ %&gt;
+</pre>
+<p>
+### Installation: First install these requirements:
+</p>
+<pre>
+ 1. gem for gbarcode
+ 2. install native ImageMagick library (and RMagick)
+</pre>
+<p>
+Next, install Barcoder:
+</p>
+<p>
+`install from git : git://github.com/perezd/barcoder.git`
+</p>
+<p>
+### Supported Barcode Formats: Gbarcode as of now allows us to generate
+barcodes in following formats:
+</p>
+<pre>
+ BARCODE_EAN
+ BARCODE_UPC
+ BARCODE_ISBN
+ BARCODE_128B
+ BARCODE_128C
+ BARCODE_128
+ BARCODE_128RAW
+ BARCODE_39
+ BARCODE_I25
+ BARCODE_CBR
+ BARCODE_MSI
+ BARCODE_PLS
+ BARCODE_93
+ BARCODE_ANY
+ BARCODE_NO_CHECKSUM
+</pre>
+<p>
+for more information on Gbarcode visit <a
+href="http://gbarcode.rubyforge.org/rdoc/index.html">gbarcode.rubyforge.org/rdoc/index.html</a>
+Many many thanks to Anuj Luthra for solving the initial hard work!
+</p>
+
+ </div>
+
+
+ </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></small></p>
+</div>
+
+</body>
+</html>
119 rdoc/files/lib/barcoder_rb.html
@@ -0,0 +1,119 @@
+<?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: barcoder.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" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ 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: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>barcoder.rb</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>lib/barcoder.rb
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Mon Nov 23 00:19:25 -0800 2009</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+Barcoder, v.1.0 written by: Derek Perez (derek@derekperez.com) 2009
+inspired (heavily) by the work of Author: Anuj Luthra. He originally wrote
+the library barcode_generator (<a
+href="http://github.com/anujluthra/barcode-generator">github.com/anujluthra/barcode-generator</a>/),
+that this library is based on.
+</p>
+<p>
+This library is designed to support streaming barcode information, from
+GBarcode, straight to the web browser using data urls (<a
+href="http://en.wikipedia.org/wiki/Data_URI_scheme">en.wikipedia.org/wiki/Data_URI_scheme</a>).
+This is ideal for no-write filesystem scenarios. It also supports
+persisting the barcodes to disk, but this is an optional function. By
+default, data urls are used.
+</p>
+
+ </div>
+
+
+ </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></small></p>
+</div>
+
+</body>
+</html>
28 rdoc/fr_class_index.html
@@ -0,0 +1,28 @@
+
+<?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">
+
+<!--
+
+ Classes
+
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Classes</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
+ <base target="docwin" />
+</head>
+<body>
+<div id="index">
+ <h1 class="section-bar">Classes</h1>
+ <div id="index-entries">
+ <a href="classes/ActionView.html">ActionView</a><br />
+ <a href="classes/ActionView/Base.html">ActionView::Base</a><br />
+ </div>
+</div>
+</body>
+</html>
28 rdoc/fr_file_index.html
@@ -0,0 +1,28 @@
+
+<?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">
+
+<!--
+
+ Files
+
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Files</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
+ <base target="docwin" />
+</head>
+<body>
+<div id="index">
+ <h1 class="section-bar">Files</h1>
+ <div id="index-entries">
+ <a href="files/README.html">README</a><br />
+ <a href="files/lib/barcoder_rb.html">lib/barcoder.rb</a><br />
+ </div>
+</div>
+</body>
+</html>
31 rdoc/fr_method_index.html
@@ -0,0 +1,31 @@
+
+<?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">
+
+<!--
+
+ Methods
+
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Methods</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
+ <base target="docwin" />
+</head>
+<body>
+<div id="index">
+ <h1 class="section-bar">Methods</h1>
+ <div id="index-entries">
+ <a href="classes/ActionView/Base.html#M000002">barcode (ActionView::Base)</a><br />
+ <a href="classes/ActionView/Base.html#M000003">barcode_to_disk (ActionView::Base)</a><br />
+ <a href="classes/ActionView/Base.html#M000004">barcode_to_stream (ActionView::Base)</a><br />
+ <a href="classes/ActionView/Base.html#M000005">get_bytes_from_barcode (ActionView::Base)</a><br />
+ <a href="classes/ActionView/Base.html#M000001">to_barcode (ActionView::Base)</a><br />
+ </div>
+</div>
+</body>
+</html>
24 rdoc/index.html
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+
+<!--
+
+ Barcoder
+
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Barcoder</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+</head>
+<frameset rows="20%, 80%">
+ <frameset cols="25%,35%,45%">
+ <frame src="fr_file_index.html" title="Files" name="Files" />
+ <frame src="fr_class_index.html" name="Classes" />
+ <frame src="fr_method_index.html" name="Methods" />
+ </frameset>
+ <frame src="files/README.html" name="docwin" />
+</frameset>
+</html>
208 rdoc/rdoc-style.css
@@ -0,0 +1,208 @@
+
+body {
+ font-family: Verdana,Arial,Helvetica,sans-serif;
+ font-size: 90%;
+ margin: 0;
+ margin-left: 40px;
+ padding: 0;
+ background: white;
+}
+
+h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
+h1 { font-size: 150%; }
+h2,h3,h4 { margin-top: 1em; }
+
+a { background: #eef; color: #039; text-decoration: none; }
+a:hover { background: #039; color: #eef; }
+
+/* Override the base stylesheet's Anchor inside a table cell */
+td > a {
+ background: transparent;
+ color: #039;
+ text-decoration: none;
+}
+
+/* and inside a section title */
+.section-title > a {
+ background: transparent;
+ color: #eee;
+ text-decoration: none;
+}
+
+/* === Structural elements =================================== */
+
+div#index {
+ margin: 0;
+ margin-left: -40px;
+ padding: 0;
+ font-size: 90%;
+}
+
+
+div#index a {
+ margin-left: 0.7em;
+}
+
+div#index .section-bar {
+ margin-left: 0px;
+ padding-left: 0.7em;
+ background: #ccc;
+ font-size: small;
+}
+
+
+div#classHeader, div#fileHeader {
+ width: auto;
+ color: white;
+ padding: 0.5em 1.5em 0.5em 1.5em;
+ margin: 0;
+ margin-left: -40px;
+ border-bottom: 3px solid #006;
+}
+
+div#classHeader a, div#fileHeader a {
+ background: inherit;
+ color: white;
+}
+
+div#classHeader td, div#fileHeader td {
+ background: inherit;
+ color: white;
+}
+
+
+div#fileHeader {
+ background: #057;
+}
+
+div#classHeader {
+ background: #048;
+}
+
+
+.class-name-in-header {
+ font-size: 180%;
+ font-weight: bold;
+}
+
+
+div#bodyContent {
+ padding: 0 1.5em 0 1.5em;
+}
+
+div#description {
+ padding: 0.5em 1.5em;
+ background: #efefef;
+ border: 1px dotted #999;
+}
+
+div#description h1,h2,h3,h4,h5,h6 {
+ color: #125;;
+ background: transparent;
+}
+
+div#validator-badges {
+ text-align: center;
+}
+div#validator-badges img { border: 0; }
+
+div#copyright {
+ color: #333;
+ background: #efefef;
+ font: 0.75em sans-serif;
+ margin-top: 5em;
+ margin-bottom: 0;
+ padding: 0.5em 2em;
+}
+
+
+/* === Classes =================================== */
+
+table.header-table {
+ color: white;
+ font-size: small;
+}
+
+.type-note {
+ font-size: small;
+ color: #DEDEDE;
+}
+
+.xxsection-bar {
+ background: #eee;
+ color: #333;
+ padding: 3px;
+}
+
+.section-bar {
+ color: #333;
+ border-bottom: 1px solid #999;
+ margin-left: -20px;
+}
+
+
+.section-title {
+ background: #79a;
+ color: #eee;
+ padding: 3px;
+ margin-top: 2em;
+ margin-left: -30px;
+ border: 1px solid #999;
+}
+
+.top-aligned-row { vertical-align: top }
+.bottom-aligned-row { vertical-align: bottom }
+
+/* --- Context section classes ----------------------- */
+
+.context-row { }
+.context-item-name { font-family: monospace; font-weight: bold; color: black; }
+.context-item-value { font-size: small; color: #448; }
+.context-item-desc { color: #333; padding-left: 2em; }
+
+/* --- Method classes -------------------------- */
+.method-detail {
+ background: #efefef;
+ padding: 0;
+ margin-top: 0.5em;
+ margin-bottom: 1em;
+ border: 1px dotted #ccc;
+}
+.method-heading {
+ color: black;
+ background: #ccc;
+ border-bottom: 1px solid #666;
+ padding: 0.2em 0.5em 0 0.5em;
+}
+.method-signature { color: black; background: inherit; }
+.method-name { font-weight: bold; }
+.method-args { font-style: italic; }
+.method-description { padding: 0 0.5em 0 0.5em; }
+
+/* --- Source code sections -------------------- */
+
+a.source-toggle { font-size: 90%; }
+div.method-source-code {
+ background: #262626;
+ color: #ffdead;
+ margin: 1em;
+ padding: 0.5em;
+ border: 1px dashed #999;
+ overflow: hidden;
+}
+
+div.method-source-code pre { color: #ffdead; overflow: hidden; }
+
+/* --- Ruby keyword styles --------------------- */
+
+.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
+
+.ruby-constant { color: #7fffd4; background: transparent; }
+.ruby-keyword { color: #00ffff; background: transparent; }
+.ruby-ivar { color: #eedd82; background: transparent; }
+.ruby-operator { color: #00ffee; background: transparent; }
+.ruby-identifier { color: #ffdead; background: transparent; }
+.ruby-node { color: #ffa07a; background: transparent; }
+.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
+.ruby-regexp { color: #ffa07a; background: transparent; }
+.ruby-value { color: #7fffd4; background: transparent; }

0 comments on commit a2daa7d

Please sign in to comment.
Something went wrong with that request. Please try again.