<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>CHANGES.txt</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,6 @@
 dm-xapian is released under the MIT License.
 Copyright (c) 2008 Joshaven Potter &lt;yourtech@gmail.com&gt;
+Copyright (c) 2008 Pascal Belloncle &lt;psq@nanorails.com&gt;
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the</diff>
      <filename>LICENSE</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@ spec = Gem::Specification.new do |s|
   s.version = GEM_VERSION
   s.platform = Gem::Platform::RUBY
   s.has_rdoc = true
-  s.extra_rdoc_files = [&quot;README.txt&quot;, &quot;LICENSE&quot;, 'TODO', 'SETUP.txt']
+  s.extra_rdoc_files = [&quot;README.txt&quot;, &quot;LICENSE&quot;, 'TODO', 'SETUP.txt', 'CHANGES.txt']
   s.summary = SUMMARY
   s.description = s.summary
   s.author = AUTHOR
@@ -26,7 +26,7 @@ spec = Gem::Specification.new do |s|
   s.homepage = HOMEPAGE
   s.add_dependency('merb', '&gt;= 0.9.7')
   s.require_path = 'lib'
-  s.files = %w(LICENSE README.txt Rakefile TODO) + Dir.glob(&quot;{lib,spec}/**/*&quot;)
+  s.files = %w(LICENSE README.txt Rakefile TODO CHANGES.txt SETUP.txt) + Dir.glob(&quot;{lib,spec}/**/*&quot;)
   
 end
 </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,20 +1,20 @@
 Gem::Specification.new do |s|
   s.name = %q{dm-xapian}
-  s.version = &quot;0.2&quot;
+  s.version = &quot;0.3&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Joshaven Potter, Pascal Belloncle&quot;]
-  s.date = %q{2008-09-21}
-  s.description = %q{Merb plugin that provides use of the Ruby Xapian search engine library}
+  s.date = %q{2008-11-08}
+  s.description = %q{Merb plugin that provides access to the Ruby Xapian search engine library}
   s.email = %q{yourtech@gmail.com, psq@nanorails.com}}
-  s.extra_rdoc_files = [&quot;README.txt&quot;, &quot;LICENSE&quot;, &quot;TODO&quot;, &quot;SETUP.txt&quot;]
-  s.files = [&quot;LICENSE&quot;, &quot;README.txt&quot;, &quot;Rakefile&quot;, &quot;TODO&quot;, &quot;lib/dm-xapian.rb&quot;, &quot;SETUP.txt&quot;]
+  s.extra_rdoc_files = [&quot;README.txt&quot;, &quot;LICENSE&quot;, &quot;TODO&quot;, &quot;SETUP.txt&quot;, &quot;CHANGES.txt&quot;]
+  s.files = [&quot;LICENSE&quot;, &quot;README.txt&quot;, &quot;Rakefile&quot;, &quot;TODO&quot;, &quot;lib/dm-xapian.rb&quot;, &quot;SETUP.txt&quot;, &quot;CHANGES.txt&quot;]
   s.has_rdoc = true
   s.homepage = %q{http://github.com/psq/dm-xapian}
   s.require_paths = [&quot;lib&quot;]
   s.rubyforge_project = %q{merb}
   s.rubygems_version = %q{1.2.0}
-  s.summary = %q{Merb plugin that provides use of the Ruby Xapian search engine library}
+  s.summary = %q{Merb plugin that provides access to the Ruby Xapian search engine library}
 
   if s.respond_to? :specification_version then
     current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION</diff>
      <filename>dm-xapian.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -26,7 +26,21 @@ namespace :xapian do
 
     raise &quot;specify ALL your models with models=\&quot;ModelName1 ModelName2\&quot; as parameter&quot; if ENV['models'].nil?
     ActsAsXapian.configure(Merb.env||'development', Merb.root)
-    ActsAsXapian.rebuild_index(ENV['models'].split(&quot; &quot;).map{|m| m.constantize}, ENV['verbose'] ? true : false)
+    # Transform the array of model strings into an array of resource classes
+    # Only retain resources which have been indexed by Xapian
+    indexed_models = DataMapper::Resource.descendants.select { |m| m.include?(DataMapper::Xapian::InstanceMethods) }
+    models_for_rebuild = []
+    found_models = nil
+    ENV['models'].split(&quot; &quot;).each do |m_name|
+       found_models = indexed_models.select { |m| m.name == m_name }
+       unless found_models.empty? 
+         models_for_rebuild &lt;&lt; found_models.first
+       else
+         raise &quot;The model name #{m_name} is either unknown to &quot; +
+           &quot;DataMapper or not indexed by Xapian&quot;
+       end
+    end
+    ActsAsXapian.rebuild_index(models_for_rebuild, ENV['verbose'] ? true : false)
   end
 
   # Parameters - are models, query, offset, limit, sort_by_prefix,
@@ -36,7 +50,7 @@ namespace :xapian do
     ActsAsXapian.configure(Merb.env||'development', Merb.root)
     raise &quot;specify models=\&quot;ModelName1 ModelName2\&quot; as parameter&quot; if ENV['models'].nil?
     raise &quot;specify query=\&quot;your terms\&quot; as parameter&quot; if ENV['query'].nil?
-    s = ActsAsXapian::Search.new(ENV['models'].split(&quot; &quot;).map{|m| m.constantize}, 
+    s = ActsAsXapian::Search.new(ENV['models'].split(&quot; &quot;), 
         ENV['query'],
         :offset =&gt; (ENV['offset'] || 0), :limit =&gt; (ENV['limit'] || 10),
         :sort_by_prefix =&gt; (ENV['sort_by_prefix'] || nil), </diff>
      <filename>lib/dm-xapian/merbtasks.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>abf27d10afda124bd37685915b6fee9ca249d019</id>
    </parent>
  </parents>
  <author>
    <name>Pascal</name>
    <email>psq@psq-imac-3.local</email>
  </author>
  <url>http://github.com/psq/dm-xapian/commit/fe86025a5873b16595ce759d17a4a779bd3fa78f</url>
  <id>fe86025a5873b16595ce759d17a4a779bd3fa78f</id>
  <committed-date>2008-11-08T21:12:50-08:00</committed-date>
  <authored-date>2008-11-08T21:12:50-08:00</authored-date>
  <message>applied Emm patch, updated version, license, added CHANGES.txt</message>
  <tree>1063786d1da69e17d8ac54843d478c34c87ba858</tree>
  <committer>
    <name>Pascal</name>
    <email>psq@psq-imac-3.local</email>
  </committer>
</commit>
