class Bundler::Patch::GemsToPatch

Attributes

gem_patches[R]

Public Class Methods

new(gem_patches) click to toggle source
# File lib/bundler/patch/conservative_definition.rb, line 112
def initialize(gem_patches)
  @gem_patches = Array(gem_patches)
  STDERR.puts "Unlocked gems: #{unlocking_description}" if ENV['DEBUG_PATCH_RESOLVER']
end

Public Instance Methods

gem_patch_for(gem_name) click to toggle source
# File lib/bundler/patch/conservative_definition.rb, line 125
def gem_patch_for(gem_name)
  @gem_patches.detect { |gp| gp.gem_name == gem_name }
end
to_bundler_definition() click to toggle source
# File lib/bundler/patch/conservative_definition.rb, line 117
def to_bundler_definition
  unlocking_all? ? true : {gems: to_gem_names}
end
to_gem_names() click to toggle source
# File lib/bundler/patch/conservative_definition.rb, line 121
def to_gem_names
  @gem_patches.map(&:gem_name)
end
unlocking_all?() click to toggle source
# File lib/bundler/patch/conservative_definition.rb, line 129
def unlocking_all?
  @gem_patches.empty?
end
unlocking_description() click to toggle source
# File lib/bundler/patch/conservative_definition.rb, line 137
def unlocking_description
  unlocking_all? ? 'ALL' : to_gem_names.sort.join(', ')
end
unlocking_gem?(gem_name) click to toggle source
# File lib/bundler/patch/conservative_definition.rb, line 133
def unlocking_gem?(gem_name)
  unlocking_all? || to_gem_names.include?(gem_name)
end