<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -39,12 +39,16 @@ namespace :activecouch do
   task :save_view do
     unless (view_name = ENV['view']).nil?
       site = YAML::load(File.open(File.join(Rails.root, 'config', 'activecouch.yml')))[Rails.env]['site']
+      
       unless(view = Object.const_get(view_name)).nil?
-        saved = ActiveCouch::Exporter.export(site, view, :database =&gt; ENV['db'])
-        if saved
-          puts &quot;View exported successfully&quot;
-        else
-          puts &quot;There was an error in the export. Please check your CouchDB logs&quot;
+        databases = ENV['db'] == '_all_dbs' ? ActiveCouch::Exporter.all_databases(site) : ENV['db']
+        databases.each do |db|
+          saved = ActiveCouch::Exporter.export(site, view, :database =&gt; db)
+          if saved
+            puts &quot;View exported successfully to #{db} on #{site}&quot;
+          else
+            puts &quot;There was an error in the export. Please check your CouchDB logs&quot;
+          end
         end
       else
         puts &quot;Have you defined your view? Use ./script/generate activecouch_view ViewName from the root of your Rails app&quot;
@@ -56,12 +60,17 @@ namespace :activecouch do
   task :delete_view do
     unless (view_name = ENV['view']).nil?
       site = YAML::load(File.open(File.join(Rails.root, 'config', 'activecouch.yml')))[Rails.env]['site']
+      
+      
       unless(view = Object.const_get(view_name)).nil?
-        deleted = ActiveCouch::Exporter.delete(site, view, :database =&gt; ENV['db'])
-        if deleted
-          puts &quot;View deleted successfully&quot;
-        else
-          puts &quot;There was an error in the deletion of the view. Please check your CouchDB logs&quot;
+        databases = ENV['db'] == '_all_dbs' ? ActiveCouch::Exporter.all_databases(site) : ENV['db']
+        databases.each do |db|
+          deleted = ActiveCouch::Exporter.delete(site, view, :database =&gt; db)
+          if deleted
+            puts &quot;View deleted successfully to #{db} on #{site}&quot;
+          else
+            puts &quot;There was an error in the deletion of the view. Please check your CouchDB logs&quot;
+          end
         end
       else
         puts &quot;Have you defined your view? Use ./script/generate activecouch_view ViewName from the root of your Rails app&quot;</diff>
      <filename>tasks/activecouch.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b91a2e55d1258d59115c2e305b83a04cbbc9b74d</id>
    </parent>
  </parents>
  <author>
    <name>Arun Thampi</name>
    <email>arun@Macintosh.(none)</email>
  </author>
  <url>http://github.com/arunthampi/activecouch/commit/bebe639d41c00a007eccfa3f9e9ea0b0fadcfb01</url>
  <id>bebe639d41c00a007eccfa3f9e9ea0b0fadcfb01</id>
  <committed-date>2008-10-22T19:56:41-07:00</committed-date>
  <authored-date>2008-10-22T19:56:41-07:00</authored-date>
  <message>save_view and delete_view Rake tasks support saving/deleting of views to all databases in CouchDB</message>
  <tree>0396bd2dd50edfbae6bd46131a5540f2285fbea0</tree>
  <committer>
    <name>Arun Thampi</name>
    <email>arun@Macintosh.(none)</email>
  </committer>
</commit>
