diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
commit | d0233291bc8a5068e52c69c210e5979e5324b5bc (patch) | |
tree | 7d9459449c33792c63eeb7baa071e76352e0baab /trunk/lib/rubygems/indexer/master_index_builder.rb | |
parent | 0dc342de848a642ecce8db697b8fecd83a63e117 (diff) | |
parent | 72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff) |
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/lib/rubygems/indexer/master_index_builder.rb')
-rw-r--r-- | trunk/lib/rubygems/indexer/master_index_builder.rb | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/trunk/lib/rubygems/indexer/master_index_builder.rb b/trunk/lib/rubygems/indexer/master_index_builder.rb deleted file mode 100644 index 669ea5a1df..0000000000 --- a/trunk/lib/rubygems/indexer/master_index_builder.rb +++ /dev/null @@ -1,54 +0,0 @@ -require 'rubygems/indexer' - -## -# Construct the master Gem index file. - -class Gem::Indexer::MasterIndexBuilder < Gem::Indexer::AbstractIndexBuilder - - def start_index - super - @index = Gem::SourceIndex.new - end - - def end_index - super - - @file.puts "--- !ruby/object:#{@index.class}" - @file.puts "gems:" - - gems = @index.sort_by { |name, gemspec| gemspec.sort_obj } - gems.each do |name, gemspec| - yaml = gemspec.to_yaml.gsub(/^/, ' ') - yaml = yaml.sub(/\A ---/, '') # there's a needed extra ' ' here - @file.print " #{gemspec.original_name}:" - @file.puts yaml - end - end - - def cleanup - super - - index_file_name = File.join @directory, @filename - - compress index_file_name, "Z" - paranoid index_file_name, "#{index_file_name}.Z" - - @files << "#{@filename}.Z" - end - - def add(spec) - @index.add_spec(spec) - end - - private - - def paranoid(path, compressed_path) - data = Gem.read_binary path - compressed_data = Gem.read_binary compressed_path - - if data != unzip(compressed_data) then - raise "Compressed file #{compressed_path} does not match uncompressed file #{path}" - end - end - -end |