Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions lib/rubygems/available_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,29 +95,6 @@ def source_for(spec)
f.source
end

##
# Converts this AvailableSet into a RequestSet that can be used to install
# gems.
#
# If +development+ is :none then no development dependencies are installed.
# Other options are :shallow for only direct development dependencies of the
# gems in this set or :all for all development dependencies.

def to_request_set(development = :none)
request_set = Gem::RequestSet.new
request_set.development = development == :all

each_spec do |spec|
request_set.always_install << spec

request_set.gem spec.name, spec.version
request_set.import spec.development_dependencies if
development == :shallow
end

request_set
end

##
#
# Used by the Resolver, the protocol to use a AvailableSet as a
Expand Down Expand Up @@ -158,8 +135,4 @@ def remove_installed!(dep)
@sorted = nil
self
end

def inject_into_list(dep_list)
@set.each {|t| dep_list.add t.spec }
end
end
9 changes: 0 additions & 9 deletions lib/rubygems/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,6 @@ def check_deprecated_options(options)
end
end

##
# Merge a set of command options with the set of default options (without
# modifying the default option hash).

def merge_options(new_options)
@options = @defaults.clone
new_options.each {|k,v| @options[k] = v }
end

##
# True if the command handles the given argument list.

Expand Down
12 changes: 0 additions & 12 deletions lib/rubygems/commands/sources_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -305,18 +305,6 @@ def update # :nodoc:
say "source cache successfully updated"
end

def remove_cache_file(desc, path) # :nodoc:
FileUtils.rm_rf path

if !File.exist?(path)
say "*** Removed #{desc} source cache ***"
elsif !File.writable?(path)
say "*** Unable to remove #{desc} source cache (write protected) ***"
else
say "*** Unable to remove #{desc} source cache ***"
end
end

private

def default_sources
Expand Down
10 changes: 0 additions & 10 deletions lib/rubygems/dependency_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,6 @@ def install(dep_or_name, version = Gem::Requirement.default)
@installed_gems
end

def install_development_deps # :nodoc:
if @development && @dev_shallow
:shallow
elsif @development
:all
else
:none
end
end

def resolve_dependencies(dep_or_name, version) # :nodoc:
request_set = Gem::RequestSet.new
request_set.development = @development
Expand Down
36 changes: 0 additions & 36 deletions lib/rubygems/dependency_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,49 +167,13 @@ def ok_to_remove?(full_name, check_dev = true)
end
end

##
# Remove everything in the DependencyList that matches but doesn't
# satisfy items in +dependencies+ (a hash of gem names to arrays of
# dependencies).

def remove_specs_unsatisfied_by(dependencies)
specs.reject! do |spec|
dep = dependencies[spec.name]
dep && !dep.requirement.satisfied_by?(spec.version)
end
end

##
# Removes the gemspec matching +full_name+ from the dependency list

def remove_by_name(full_name)
@specs.delete_if {|spec| spec.full_name == full_name }
end

##
# Return a hash of predecessors. <tt>result[spec]</tt> is an Array of
# gemspecs that have a dependency satisfied by the named gemspec.

def spec_predecessors
result = Hash.new {|h,k| h[k] = [] }

specs = @specs.sort.reverse

specs.each do |spec|
specs.each do |other|
next if spec == other

other.dependencies.each do |dep|
if spec.satisfies_requirement? dep
result[spec] << other
end
end
end
end

result
end

def tsort_each_node(&block)
@specs.each(&block)
end
Expand Down
8 changes: 0 additions & 8 deletions lib/rubygems/resolver/dependency_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ def explicit?
@requester.nil?
end

##
# Indicate that the request is for a gem requested as a dependency of
# another gem

def implicit?
!explicit?
end

##
# Return a String indicating who caused this request to be added (only
# valid for implicit requests)
Expand Down
Loading