summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/cli/doctor.rb4
-rw-r--r--lib/bundler/cli/info.rb4
-rw-r--r--lib/bundler/definition.rb2
-rw-r--r--lib/bundler/dependency.rb2
-rw-r--r--lib/bundler/dsl.rb2
-rw-r--r--lib/bundler/gem_helpers.rb2
-rw-r--r--lib/bundler/resolver.rb4
-rw-r--r--lib/bundler/resolver/base.rb4
-rw-r--r--lib/bundler/runtime.rb4
-rw-r--r--lib/bundler/source/path.rb4
-rw-r--r--lib/rubygems/commands/contents_command.rb4
-rw-r--r--lib/rubygems/ext/cargo_builder.rb3
-rw-r--r--lib/rubygems/resolver.rb2
-rw-r--r--lib/rubygems/source/git.rb4
14 files changed, 22 insertions, 23 deletions
@@ -32,11 +32,11 @@ module Bundler
def dylibs_ldd(path)
output = `/usr/bin/ldd #{path.shellescape}`.chomp
- output.split("\n").map do |l|
match = l.match(LDD_REGEX)
next if match.nil?
match.captures[0]
- end.compact
end
def dylibs(path)
@@ -73,11 +73,11 @@ module Bundler
end
def gem_dependencies
- @gem_dependencies ||= Bundler.definition.specs.map do |spec|
dependency = spec.dependencies.find {|dep| dep.name == gem_name }
next unless dependency
"#{spec.name} (#{spec.version}) depends on #{gem_name} (#{dependency.requirements_list.join(", ")})"
- end.compact.sort
end
end
end
@@ -341,7 +341,7 @@ module Bundler
end
def spec_git_paths
- sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact
end
def groups
@@ -62,7 +62,7 @@ module Bundler
end
def expanded_platforms
- @expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.flatten.uniq
end
def should_include?
@@ -66,7 +66,7 @@ module Bundler
development_group = opts[:development_group] || :development
expanded_path = gemfile_root.join(path)
- gemspecs = Gem::Util.glob_files_in_dir("{,*}.gemspec", expanded_path).map {|g| Bundler.load_gemspec(g) }.compact
gemspecs.reject! {|s| s.name != name } if name
specs_by_name_and_version = gemspecs.group_by {|s| [s.name, s.version] }
@@ -63,7 +63,7 @@ module Bundler
module_function :select_best_platform_match
def select_best_local_platform_match(specs, force_ruby: false, most_specific_locked_platform: nil)
- select_best_platform_match(specs, local_platform, force_ruby: force_ruby).map {|spec| spec.materialize_for_installation(most_specific_locked_platform) }.compact
end
module_function :select_best_local_platform_match
@@ -417,7 +417,7 @@ module Bundler
end
def prepare_dependencies(requirements, packages)
- to_dependency_hash(requirements, packages).map do |dep_package, dep_constraint|
name = dep_package.name
next [dep_package, dep_constraint] if name == "bundler"
@@ -443,7 +443,7 @@ module Bundler
next unless dep_package.current_platform?
raise_not_found!(dep_package)
- end.compact.to_h
end
def select_sorted_versions(package, range)
@@ -16,7 +16,7 @@ module Bundler
hash[name] = Package.new(name, platforms, **options)
end
- @requirements = dependencies.map do |dep|
dep_platforms = dep.gem_platforms(platforms)
# Dependencies scoped to external platforms are ignored
@@ -27,7 +27,7 @@ module Bundler
@packages[name] = Package.new(name, dep_platforms, **options.merge(dependency: dep))
dep
- end.compact
end
def specs_compatible_with(result)
@@ -263,10 +263,10 @@ module Bundler
def setup_manpath
# Add man/ subdirectories from activated bundles to MANPATH for man(1)
- manuals = $LOAD_PATH.map do |path|
man_subdir = path.sub(/lib$/, "man")
man_subdir unless Dir[man_subdir + "/man?/"].empty?
- end.compact
return if manuals.empty?
Bundler::SharedHelpers.set_env "MANPATH", manuals.concat(
@@ -214,7 +214,7 @@ module Bundler
# Some gem authors put absolute paths in their gemspec
# and we have to save them from themselves
- spec.files = spec.files.map do |path|
next path unless /\A#{Pathname::SEPARATOR_PAT}/o.match?(path)
next if File.directory?(path)
begin
@@ -222,7 +222,7 @@ module Bundler
rescue ArgumentError
path
end
- end.compact
installer = Path::Installer.new(
spec,
@@ -102,7 +102,7 @@ prefix or only the files that are requireable.
end
def files_in_default_gem(spec)
- spec.files.map do |file|
if file.start_with?("#{spec.bindir}/")
[RbConfig::CONFIG["bindir"], file.delete_prefix("#{spec.bindir}/")]
else
@@ -119,7 +119,7 @@ prefix or only the files that are requireable.
[resolve.delete_suffix(requirable_part), requirable_part]
end
- end.compact
end
def gem_contents(name)
@@ -252,8 +252,7 @@ EOF
def rustc_dynamic_linker_flags(dest_dir, crate_name)
split_flags("DLDFLAGS").
- map {|arg| maybe_resolve_ldflag_variable(arg, dest_dir, crate_name) }.
- compact.
flat_map {|arg| ldflag_to_link_modifier(arg) }
end
@@ -183,7 +183,7 @@ class Gem::Resolver
# Proceed with resolution! Returns an array of ActivationRequest objects.
def resolve
- Gem::Molinillo::Resolver.new(self, self).resolve(@needed.map {|d| DependencyRequest.new d, nil }).tsort.map(&:payload).compact
rescue Gem::Molinillo::VersionConflict => e
conflict = e.conflicts.values.first
raise Gem::DependencyResolutionError, Conflict.new(conflict.requirement_trees.first.first, conflict.existing, conflict.requirement)
@@ -201,7 +201,7 @@ class Gem::Source::Git < Gem::Source
return [] unless install_dir
Dir.chdir install_dir do
- Dir["{,*,*/*}.gemspec"].map do |spec_file|
directory = File.dirname spec_file
file = File.basename spec_file
@@ -218,7 +218,7 @@ class Gem::Source::Git < Gem::Source
end
spec
end
- end.compact
end
end