Commit 6e203f3c authored by Samuel E. Giddins's avatar Samuel E. Giddins

[RuboCop] Use Symbol.to_proc everywhere!

parent 42323117
......@@ -116,7 +116,7 @@ module Pod
if @name
dirs = File.exist?(@name) ? [Pathname.new(@name)] : [dir]
else
dirs = config.repos_dir.children.select { |c| c.directory? }
dirs = config.repos_dir.children.select(&:directory?)
end
dirs.each do |dir|
SourcesManager.check_version_information(dir)
......
......@@ -27,7 +27,7 @@ module Pod
def self.default_ld_flags(target)
ld_flags = '-ObjC'
if target.target_definition.podfile.set_arc_compatibility_flag? &&
target.spec_consumers.any? { |consumer| consumer.requires_arc? }
target.spec_consumers.any?(&:requires_arc?)
ld_flags << ' -fobjc-arc'
end
ld_flags
......
......@@ -307,9 +307,7 @@ module Pod
def clean_pod_sources
return unless config.clean?
return unless @pod_installers
@pod_installers.each do |pod_installer|
pod_installer.clean!
end
@pod_installers.each(&:clean!)
end
# Performs any post-installation actions
......@@ -598,7 +596,7 @@ module Pod
# @return [Array<PodRepresentation>]
#
def pod_reps
root_specs.sort_by { |spec| spec.name }.map { |spec| pod_rep(spec.name) }
root_specs.sort_by(&:name).map { |spec| pod_rep(spec.name) }
end
# Returns the libraries which use the given specification.
......@@ -631,7 +629,7 @@ module Pod
# installation.
#
def root_specs
analysis_result.specifications.map { |spec| spec.root }.uniq
analysis_result.specifications.map(&:root).uniq
end
# @return [SpecsState] The state of the sandbox returned by the analyzer.
......
......@@ -272,7 +272,7 @@ module Pod
return unless allow_pre_downloads?
deps_to_fetch = []
deps_to_fetch_if_needed = []
deps_with_external_source = podfile.dependencies.select { |dep| dep.external_source }
deps_with_external_source = podfile.dependencies.select(&:external_source)
if update_mode == :all
deps_to_fetch = deps_with_external_source
......
......@@ -263,7 +263,7 @@ module Pod
file_accessors.map(&:source_files),
]
files.flatten.compact.map { |path| path.to_s }.uniq
files.flatten.compact.map(&:to_s).uniq
end
#-----------------------------------------------------------------------#
......
......@@ -127,7 +127,7 @@ module Pod
# @return [void]
#
def warn_about_empty_podfile
if podfile.target_definitions.values.all? { |td| td.empty? }
if podfile.target_definitions.values.all?(&:empty?)
UI.warn '[!] The Podfile does not contain any dependencies.'
end
end
......@@ -185,9 +185,7 @@ module Pod
# @note Empty target definitions are ignored.
#
def user_project_paths
targets.map do |target|
target.user_project_path
end.compact.uniq
targets.map(&:user_project_path).compact.uniq
end
def targets_to_integrate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment