<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -35,6 +35,8 @@ task :generate_parser do
   sh 'tt grammar/uri_template.treetop -o lib/uri/grammar.rb'
 end
 
+#task :test =&gt; [:generate_parser]
+
 desc 'Measures test coverage'
 Rcov::RcovTask.new(&quot;coverage&quot;) do |t|
   t.test_files = FileList['test/test_*.rb']</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -42,13 +42,13 @@ grammar UriTemplate
   rule op
     (
     'opt' {
-         # If one or more of the variables are defined and non-empty then
-           # substitute the value of 'arg', otherwise substitute the empty string.
+		# If each variable is undefined or an empty list then substitute the
+		# empty string, otherwise substitute the value of 'arg'.
          def exec
            lambda do |env, arg, vars|
              ret = ''
              vars.split(',').each do |var| 
-               if !env[var].to_s.blank?
+               if env[var] &amp;&amp; (env[var].respond_to?(:length) ? env[var].length &gt; 0 : true)
                  ret = &quot;#{arg}&quot;
                  break
                end</diff>
      <filename>grammar/uri_template.treetop</filename>
    </modified>
    <modified>
      <diff>@@ -243,13 +243,13 @@ module UriTemplate
   end
 
   module Op0
-    # If one or more of the variables are defined and non-empty then
-      # substitute the value of 'arg', otherwise substitute the empty string.
+		# If each variable is undefined or an empty list then substitute the
+		# empty string, otherwise substitute the value of 'arg'.
     def exec
       lambda do |env, arg, vars|
         ret = ''
         vars.split(',').each do |var| 
-          if !env[var].to_s.blank?
+          if env[var] &amp;&amp; (env[var].respond_to?(:length) ? env[var].length &gt; 0 : true)
             ret = &quot;#{arg}&quot;
             break
           end</diff>
      <filename>lib/uri/grammar.rb</filename>
    </modified>
    <modified>
      <diff>@@ -208,7 +208,7 @@ class TestUriTemplateGrammar &lt; Test::Unit::TestCase
 #      ['http://example.org/fred/fred//wilma', 'http://example.org/{bar}{-prefix|/|fred}'],
 #      [':%E1%B9%A1:%E1%B9%A1:', '{-neg|:|corge}{-suffix|:|plugh}'],
       ['../ben%20%26%20jerrys/', '../{waldo}/'],
-#      ['telnet:192.0.2.16:80', 'telnet:192.0.2.16{-opt|:80|grault}'],
+#      ['telnet:192.0.2.16:80', 'telnet:192.0.2.16{-opt|:80|grault}'],    # Test seems to be wrong
       [':200:', ':{1-a_b.c}:']
     ].each do |test|
       assert_equal test.first, @parser.parse(test.last).value(defaults)</diff>
      <filename>test/test_uri_template_grammar.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2e7b62d150169051d2ce7d5b828289259161fb77</id>
    </parent>
  </parents>
  <author>
    <name>Stefan Saasen</name>
    <email>stefan@coravy.com</email>
  </author>
  <url>http://github.com/juretta/uri-templates/commit/2a5650a03addab38f3c4bf4c9ef0c80fbf1b5a78</url>
  <id>2a5650a03addab38f3c4bf4c9ef0c80fbf1b5a78</id>
  <committed-date>2009-05-21T02:10:12-07:00</committed-date>
  <authored-date>2008-12-06T14:34:07-08:00</authored-date>
  <message>WIP: Changed the behaviour of the 'opt' operator slighlty according to the 0.3 draft.</message>
  <tree>98123070bccf2adcb6f5a50bc8ee9d9ba608267d</tree>
  <committer>
    <name>Stefan Saasen</name>
    <email>stefan@coravy.com</email>
  </committer>
</commit>
