Skip to content
Browse files

Making sure saved gems can be read

  • Loading branch information...
1 parent 5f2e5a8 commit 50c91dc3a8131477cc631c345d0185b68c49dc2d @qrush qrush committed May 24, 2009
Showing with 19 additions and 4 deletions.
  1. +17 −4 Rakefile
  2. +1 −0 app/cutter.rb
  3. +1 −0 spec/cutter_spec.rb
View
21 Rakefile
@@ -7,24 +7,37 @@ task :default => [:spec]
desc "Clean out files that aren't needed."
task :clean do
- system("git clean -dfx server/")
+ system("git clean -dfx server/; git checkout server/")
end
Spec::Rake::SpecTask.new do |t|
t.spec_opts = ['--format', 'progress', '--color', '--backtrace']
end
-namespace :indexer do
+desc "Get the gem server up and running"
+task :bootstrap do
+ Rake::Task["clean"].execute
+ ARGV[1] = "bench/old"
+ Rake::Task["import:process"].execute
+ Rake::Task["index:create"].execute
+ ARGV[1] = "bench/new"
+ Rake::Task["import:process"].execute
+ Rake::Task["index:update"].execute
+end
+
+namespace :index do
desc "Create the index"
task :create do
- require './app/cutter'
+ require 'app/cutter'
+ require 'app/indexer'
Gem::Cutter.indexer.generate_index
end
desc "Update the index"
task :update do
- require './app/cutter'
+ require 'app/cutter'
+ require 'app/indexer'
Gem::Cutter.indexer.update_index
end
View
1 app/cutter.rb
@@ -61,6 +61,7 @@ def save(temp)
self.exists = File.exists?(spec_path)
FileUtils.cp temp.path, cache_path
+ File.chmod 0644, cache_path
File.open(spec_path, "w") do |f|
f.write ruby_spec
end
View
1 spec/cutter_spec.rb
@@ -16,6 +16,7 @@ def @spec.original_name() end;
def mock_save_and_index
mock(FileUtils).cp(@temp_path, @cache_path)
+ mock(File).chmod(0644, @cache_path)
mock(File).open(@spec_path, 'w')
index = "index"

0 comments on commit 50c91dc

Please sign in to comment.
Something went wrong with that request. Please try again.