Commit d31b291e authored by Kyle Fuller's avatar Kyle Fuller

[spec command] Fix weirdly indented code block

parent f44ca638
...@@ -118,29 +118,28 @@ module Pod ...@@ -118,29 +118,28 @@ module Pod
def podspecs_to_lint def podspecs_to_lint
@podspecs_to_lint ||= begin @podspecs_to_lint ||= begin
files = [] files = []
@podspecs_paths << '.' if @podspecs_paths.empty? @podspecs_paths << '.' if @podspecs_paths.empty?
@podspecs_paths.each do |path| @podspecs_paths.each do |path|
if path =~ /https?:\/\// if path =~ /https?:\/\//
require 'open-uri' require 'open-uri'
output_path = podspecs_tmp_dir + File.basename(path) output_path = podspecs_tmp_dir + File.basename(path)
output_path.dirname.mkpath output_path.dirname.mkpath
open(path) do |io| open(path) do |io|
output_path.open('w') { |f| f << io.read } output_path.open('w') { |f| f << io.read }
end
files << output_path
elsif (pathname = Pathname.new(path)).directory?
files += Pathname.glob(pathname + '**/*.podspec{.json,}')
raise Informative, 'No specs found in the current directory.' if files.empty?
else
files << (pathname = Pathname.new(path))
raise Informative, "Unable to find a spec named `#{path}'." unless pathname.exist? && path.include?('.podspec')
end end
files << output_path
else if (pathname = Pathname.new(path)).directory?
files += Pathname.glob(pathname + '**/*.podspec{.json,}')
raise Informative, 'No specs found in the current directory.' if files.empty?
else
files << (pathname = Pathname.new(path))
raise Informative, "Unable to find a spec named `#{path}'." unless pathname.exist? && path.include?('.podspec')
end end
files
end end
end
files
end end
end
def podspecs_tmp_dir def podspecs_tmp_dir
Pathname(File.join(Pathname.new('/tmp').realpath, '/CocoaPods/Lint_podspec')) Pathname(File.join(Pathname.new('/tmp').realpath, '/CocoaPods/Lint_podspec'))
......
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