<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -234,8 +234,9 @@ module StrokeDB
   end
   
   class &lt;&lt; View
-    def [](name)
-      # TODO: find viewdoc by name
+    def [](name, nsurl = Meta.default_nsurl)  # FIXME: Meta seems to be a bad place for default_nsurl now
+      uuid = ::Util.sha1_uuid(&quot;view:#{nsurl}##{name}&quot;) 
+      StrokeDB.default_store.find(uuid)
     end
 
     alias :original_new :new
@@ -259,7 +260,7 @@ module StrokeDB
         raise ArgumentError, &quot;View name must be specified!&quot;
       end
       
-      nsurl = options['nsurl'] ||= Meta.default_nsurl # FIXME: Meta seems to be a bad palce for default_nsurl now
+      nsurl = options['nsurl'] ||= Meta.default_nsurl # FIXME: Meta seems to be a bad place for default_nsurl now
       
       options['uuid'] = ::Util.sha1_uuid(&quot;view:#{nsurl}##{name}&quot;) 
       </diff>
      <filename>lib/strokedb/views/view.rb</filename>
    </modified>
    <modified>
      <diff>@@ -112,4 +112,26 @@ describe View, &quot;with block defined and saved&quot; do
     @view.send(:storage).object_id.should == storage_id
   end
   
-end
\ No newline at end of file
+  it &quot;should be findable with #[] syntax&quot; do
+    View[&quot;SomeView&quot;].should == @view
+  end
+  
+end
+
+
+describe View, &quot;with nsurl and block defined and saved&quot; do
+  
+  before(:each) do
+    setup_default_store
+    @view = View.define!(&quot;SomeView&quot;, :nsurl =&gt; &quot;http://strokedb.com/&quot;) do |view|
+      def view.map(uuid, doc)
+        [[doc,doc]]
+      end
+    end
+  end
+  it &quot;should be findable with #[] syntax&quot; do
+    View[&quot;SomeView&quot;, &quot;http://strokedb.com/&quot;].should == @view
+  end
+  
+end
+</diff>
      <filename>spec/lib/strokedb/views/view_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cd9a00e70e4a197c121fef6fc62361e948fdd037</id>
    </parent>
  </parents>
  <author>
    <name>Yurii Rashkovskii</name>
    <email>yrashk@gmail.com</email>
  </author>
  <url>http://github.com/yrashk/strokedb/commit/3fbc394d5cd33891b157318e7984ec3d7b8dff7e</url>
  <id>3fbc394d5cd33891b157318e7984ec3d7b8dff7e</id>
  <committed-date>2008-04-29T00:06:51-07:00</committed-date>
  <authored-date>2008-04-29T00:06:51-07:00</authored-date>
  <message>View#[] syntax has been implemented [#13 responsible:yrashk state:resolved]</message>
  <tree>b38e88e724742ee7b4cc0c8427fe5ee7898cd244</tree>
  <committer>
    <name>Yurii Rashkovskii</name>
    <email>yrashk@gmail.com</email>
  </committer>
</commit>
