Permalink
Browse files

Merge pull request #1 from kreeger/master

Altering ".get" to ".git" in Gemfile.
  • Loading branch information...
2 parents 840bc16 + f282955 commit 8c60f9583feb8b7644da04f11ef44369e774da7f @sam committed Feb 21, 2012
Showing with 20 additions and 7 deletions.
  1. +1 −1 Gemfile
  2. +1 −1 README
  3. +4 −2 config.ru
  4. +14 −3 reindexer.rb
View
@@ -3,4 +3,4 @@ source :gemcutter
gem "rake"
gem "geminabox"
gem "resque"
-gem "redis_directory", :git => "git://github.com/wiecklabs/redis_directory.get"
+gem "redis_directory", :git => "git://github.com/wiecklabs/redis_directory.git"
View
@@ -65,7 +65,7 @@ running on localhost:
git clone git://github.com/sam/geminaboxplus.git
cd geminaboxplus
bundle install --path vendor
- rake resque:work &
+ QUEUE=reindex bundle exec rake resque:work &
GEMINABOX_DATA="$(pwd)/data" jruby -S trinidad
Now just copy your .gem files into $GEMINABOX_DATA/gems and run:
View
@@ -3,9 +3,11 @@ require "boot"
class Geminabox
private
- def reindex
+
+ def reindex(force_rebuild = false)
Geminabox.fixup_bundler_rubygems!
- Resque.enqueue(Reindexer, settings.data)
+ force_rebuild = true unless settings.incremental_updates
+ Resque.enqueue(Reindexer, settings.data, force_rebuild)
end
end
View
@@ -1,8 +1,19 @@
class Reindexer
@queue = :reindex
- def self.perform(data)
- Geminabox.fixup_bundler_rubygems!
- Gem::Indexer.new(data).generate_index
+ def self.perform(data, force_rebuild)
+ Gem.post_reset{ Gem::Specification.all = nil }
+ indexer = Gem::Indexer.new(data)
+ if force_rebuild
+ indexer.generate_index
+ else
+ begin
+ indexer.update_index
+ rescue => e
+ puts "#{e.class}:#{e.message}"
+ puts e.backtrace.join("\n")
+ perform(indexer, true)
+ end
+ end
end
end

0 comments on commit 8c60f95

Please sign in to comment.