<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>COPYING</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,12 +1,39 @@
-rQRCode
-=======
+= rQRCode, Encode QRCodes
 
-A library for encoding QR Codes in Ruby. Adapted from the Javascript library:
+rQRCode is a library for encoding QR Codes in Ruby. It has a simple interface with all the standard qrcode options. It was adapted from the Javascript library by Kazuhiko Arase.
 
-// QRCode for ActionScript - version 1.0.1 - Kazuhiko Arase
+= An Overview
 
+Let's clear up what rQRCode is.
+
+# rQRCode is a *standalone library*. It requires no other libraries. Just Ruby!
+# It is an encoding library. You can't decode QR codes with it.
+# The interface is simple and assumes you just want to parse a string into a QR code
+# QR code is trademarked by Denso Wave inc
+
+= Rescources
+
+# wikipedia [http://en.wikipedia.org/wiki/QR_Code]
+# Denso-Wave website [http://www.denso-wave.com/qrcode/index-e.html]
+# kaywa [http://qrcode.kaywa.com/]
+
+
+== Installing
+
+You may get the latest stable version from Rubyforge. Source gems are also available.
+
+  $ gem install rqrcode
+
+=== Loading rQRCode Itself
+
+You have installed the gem already, yeah?
+
+ require 'rubygems'
+ require 'qrqcode'
+
+=== Simple QRCode generation to screen
+
+ qr = RQRCode::QRCode.create('my string to generate')
+ qr.to_console
 
-Usage
-=====
 
-qr = RQRCode::QRCode.new( :size =&gt; </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -54,7 +54,7 @@ module RQRCode
     PAD0 = 0xEC
     PAD1 = 0x11	
 
-    def initialize( options = {} )
+    def initialize( data, options = {} )
       options						    = options.stringify_keys
       @type_number	        = options[&quot;size&quot;] || 4
       level									= options[&quot;level&quot;] || &quot;h&quot; 
@@ -63,14 +63,17 @@ module RQRCode
       @module_count					= 0
       @data_cache						= nil
       @data_list						= [] 
+			@data									= data
+
+			self.create # let's go !
     end
 
 
-    def add_data( data )
-      new_data = QR8bitByte.new( data )
-      @data_list &lt;&lt; new_data
-      @data_cache = nil
-    end
+		def create
+			raise ArgumentError if @data.nil? || @data.size == 0
+			@data_list &lt;&lt; QR8bitByte.new( @data )
+      make_impl( false, get_best_mask_pattern )
+		end
 
 
     def is_dark( row, col )
@@ -82,11 +85,6 @@ module RQRCode
     end
 
 
-    def make
-      make_impl( false, get_best_mask_pattern )
-    end
-
-
     def make_impl( test, mask_pattern )
       @module_count = @type_number * 4 + 17
       @modules = Array.new( @module_count )</diff>
      <filename>lib/rqrcode/qrcode.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,20 +3,25 @@ require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;test_helper&quot;)
 class QRCodeTest &lt; Test::Unit::TestCase
 	require File.dirname(__FILE__) + &quot;/test_data&quot;
   
+	def test_argument_error
+		assert_raise(ArgumentError) {
+			qr = RQRCode::QRCode.new( :size =&gt; 1 )
+		}
+	end
+
   def test_1_H_
-		qr = RQRCode::QRCode.new( :size =&gt; 1 )
-		qr.add_data('duncan')
-		qr.make
+		qr = RQRCode::QRCode.new( 'duncan', :size =&gt; 1 )
 
     assert_equal qr.modules.length, 21
     assert_equal qr.module_count, 21
 		assert_equal qr.modules, MATRIX_1_H
+
+		qr = RQRCode::QRCode.new( 'duncan', :size =&gt; 1 )
+		assert_equal qr.modules, MATRIX_1_H
   end
 
   def test_3_H_
-		qr = RQRCode::QRCode.new( :size =&gt; 3 )
-		qr.add_data('duncan')
-		qr.make
+		qr = RQRCode::QRCode.new( 'duncan', :size =&gt; 3 )
 
     assert_equal qr.modules.length, 29
     assert_equal qr.module_count, 29
@@ -24,9 +29,7 @@ class QRCodeTest &lt; Test::Unit::TestCase
   end
 
   def test_5_H_
-		qr = RQRCode::QRCode.new( :size =&gt; 5 )
-		qr.add_data('duncan')
-		qr.make
+		qr = RQRCode::QRCode.new( 'duncan', :size =&gt; 5 )
 
     assert_equal qr.modules.length, 37
     assert_equal qr.module_count, 37
@@ -34,9 +37,7 @@ class QRCodeTest &lt; Test::Unit::TestCase
   end
 
   def test_10_H_
-		qr = RQRCode::QRCode.new( :size =&gt; 10 )
-		qr.add_data('duncan')
-		qr.make
+		qr = RQRCode::QRCode.new( 'duncan', :size =&gt; 10 )
 
     assert_equal qr.modules.length, 57
     assert_equal qr.module_count, 57
@@ -44,9 +45,7 @@ class QRCodeTest &lt; Test::Unit::TestCase
   end
 
   def test_4_H_
-		qr = RQRCode::QRCode.new
-		qr.add_data('www.bbc.co.uk/programmes/b0090blw')
-		qr.make
+		qr = RQRCode::QRCode.new('www.bbc.co.uk/programmes/b0090blw')
 
     assert_equal qr.modules.length, 33
     assert_equal qr.module_count, 33</diff>
      <filename>test/unit/qrcode_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e09c73f51591d61579312f3a015eb85b4b414610</id>
    </parent>
  </parents>
  <author>
    <name>whomwah</name>
    <email>whomwah@70f6ffcc-3070-48c7-8e95-2772f12856e8</email>
  </author>
  <url>http://github.com/whomwah/rqrcode/commit/90d5ca421ccf89f3c30d569d85714f5c6843119a</url>
  <id>90d5ca421ccf89f3c30d569d85714f5c6843119a</id>
  <committed-date>2008-02-22T07:04:35-08:00</committed-date>
  <authored-date>2008-02-22T07:04:35-08:00</authored-date>
  <message>let's try and make the interface nicer


git-svn-id: svn+ssh://rubyforge/var/svn/rqrcode/trunk@9 70f6ffcc-3070-48c7-8e95-2772f12856e8</message>
  <tree>52a58d90e509c42ea278266fdc70e90e11640545</tree>
  <committer>
    <name>whomwah</name>
    <email>whomwah@70f6ffcc-3070-48c7-8e95-2772f12856e8</email>
  </committer>
</commit>
