Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Remove some dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
Yehuda Katz committed Jul 7, 2009
1 parent 7ec1bce commit 86614ff
Showing 1 changed file with 1 addition and 57 deletions.
58 changes: 1 addition & 57 deletions lib/bundler.rb
Expand Up @@ -2,31 +2,6 @@
require "rubygems/remote_fetcher"
require "pp"

# module Bundler
# class LazySourceIndex
#
# def initialize
# @cache = Hash.new
# @cache_two = Hash.new do |h,(gem_info,uri)|
# puts "FETCHING: #{gem_info}"
# h[[gem_info,uri]] = Gem::SpecFetcher.fetcher.fetch_spec(gem_info, URI.parse(uri))
# end
# end
#
# def search(gem_pattern, platform_only = false)
# start = Time.now
# retval = @cache[gem_pattern.hash] ||= begin
# Gem::SpecFetcher.fetcher.find_matching(gem_pattern, true, true).map do |result|
# @cache_two[result]
# end
# end
# $time += Time.now - start
# retval
# end
#
# end
# end

class FasterSourceIndex
def initialize(index)
@index = index
Expand Down Expand Up @@ -62,47 +37,16 @@ def search(dependency)
"merb-core" => ">= 0",
"merb-haml" => ">= 0",
"merb_datamapper" => ">= 0"

# "merb-core" => "1.0.12",
# "merb-haml" => "1.0.12",
# "merb_datamapper" => "1.0.12"
}.map {|k,v| Gem::Dependency.new(k, v)}

require File.expand_path(File.join(File.dirname(__FILE__), "..", "gem_resolver", "lib", "gem_resolver"))
pp GemResolver.resolve(list, index).all_specs.map {|x| x.full_name }

puts "TOTAL: #{Time.now - t}"

# index = Bundler::LazySourceIndex.new
# pp index.search(Gem::Dependency.new("merb-core", "> 0"))

# time = Time.now
# deflated = Gem::RemoteFetcher.fetcher.fetch_path("#{Gem.sources.first}/Marshal.4.8.Z"); nil
# inflated = Gem.inflate deflated; nil
# index = Marshal.load(inflated); nil
# File.open("dumped", "w") do |f|
# f.puts inflated
# end
# puts "FINISHED INFLATING: #{Time.now - time}s"




# require "ruby-prof"
#
# RubyProf.start
#
# resolved = GemResolver.resolve([Gem::Dependency.new("rails", "> 0")], index)
#
# result = RubyProf.stop
#
# printer = RubyProf::GraphPrinter.new(result)
# printer.print
#
# pp resolved.all_specs.map {|x| [x.name, x.version]}

# Gem::SpecFetcher.fetcher.find_matching(dependency) returns
# [[["merb-core", #<Gem::Version "1.0.12">, "ruby"], "http://gems.rubyforge.org/"]]
#
# Gem::SpecFetcher.fetcher.fetch_spec(["merb-core", Gem::Version.new("0.9.2"), "ruby"], URI.parse("http://gems.rubyforge.org/"))
# Gem::Specification
# end

0 comments on commit 86614ff

Please sign in to comment.