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 ...@@ -116,7 +116,7 @@ module Pod
if @name if @name
dirs = File.exist?(@name) ? [Pathname.new(@name)] : [dir] dirs = File.exist?(@name) ? [Pathname.new(@name)] : [dir]
else else
dirs = config.repos_dir.children.select { |c| c.directory? } dirs = config.repos_dir.children.select(&:directory?)
end end
dirs.each do |dir| dirs.each do |dir|
SourcesManager.check_version_information(dir) SourcesManager.check_version_information(dir)
......
...@@ -27,7 +27,7 @@ module Pod ...@@ -27,7 +27,7 @@ module Pod
def self.default_ld_flags(target) def self.default_ld_flags(target)
ld_flags = '-ObjC' ld_flags = '-ObjC'
if target.target_definition.podfile.set_arc_compatibility_flag? && 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' ld_flags << ' -fobjc-arc'
end end
ld_flags ld_flags
......
...@@ -307,9 +307,7 @@ module Pod ...@@ -307,9 +307,7 @@ module Pod
def clean_pod_sources def clean_pod_sources
return unless config.clean? return unless config.clean?
return unless @pod_installers return unless @pod_installers
@pod_installers.each do |pod_installer| @pod_installers.each(&:clean!)
pod_installer.clean!
end
end end
# Performs any post-installation actions # Performs any post-installation actions
...@@ -598,7 +596,7 @@ module Pod ...@@ -598,7 +596,7 @@ module Pod
# @return [Array<PodRepresentation>] # @return [Array<PodRepresentation>]
# #
def pod_reps 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 end
# Returns the libraries which use the given specification. # Returns the libraries which use the given specification.
...@@ -631,7 +629,7 @@ module Pod ...@@ -631,7 +629,7 @@ module Pod
# installation. # installation.
# #
def root_specs def root_specs
analysis_result.specifications.map { |spec| spec.root }.uniq analysis_result.specifications.map(&:root).uniq
end end
# @return [SpecsState] The state of the sandbox returned by the analyzer. # @return [SpecsState] The state of the sandbox returned by the analyzer.
......
...@@ -272,7 +272,7 @@ module Pod ...@@ -272,7 +272,7 @@ module Pod
return unless allow_pre_downloads? return unless allow_pre_downloads?
deps_to_fetch = [] deps_to_fetch = []
deps_to_fetch_if_needed = [] 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 if update_mode == :all
deps_to_fetch = deps_with_external_source deps_to_fetch = deps_with_external_source
......
...@@ -263,7 +263,7 @@ module Pod ...@@ -263,7 +263,7 @@ module Pod
file_accessors.map(&:source_files), file_accessors.map(&:source_files),
] ]
files.flatten.compact.map { |path| path.to_s }.uniq files.flatten.compact.map(&:to_s).uniq
end end
#-----------------------------------------------------------------------# #-----------------------------------------------------------------------#
......
...@@ -127,7 +127,7 @@ module Pod ...@@ -127,7 +127,7 @@ module Pod
# @return [void] # @return [void]
# #
def warn_about_empty_podfile 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.' UI.warn '[!] The Podfile does not contain any dependencies.'
end end
end end
...@@ -185,9 +185,7 @@ module Pod ...@@ -185,9 +185,7 @@ module Pod
# @note Empty target definitions are ignored. # @note Empty target definitions are ignored.
# #
def user_project_paths def user_project_paths
targets.map do |target| targets.map(&:user_project_path).compact.uniq
target.user_project_path
end.compact.uniq
end end
def targets_to_integrate 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