Commit bf1535a9 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Use proper TMPDIR instead of /tmp

parent db45e7a6
......@@ -16,6 +16,7 @@ end
module Pod
require 'pathname'
require 'tmpdir'
require 'cocoapods/gem_version'
require 'cocoapods-core'
......
......@@ -97,7 +97,7 @@ module Pod
end
def podspecs_tmp_dir
Pathname(File.join(Pathname.new('/tmp').realpath, '/CocoaPods/Lint_podspec'))
Pathname.new(Dir.tmpdir) + '/CocoaPods/Lint_podspec'
end
end
end
......
......@@ -183,7 +183,7 @@ module Pod
# @return [Pathname] the temporary directory used by the linter.
#
def validation_dir
Pathname.new(File.join(Pathname.new('/tmp').realpath, 'CocoaPods/Lint'))
Pathname(Dir.tmpdir) + 'CocoaPods/Lint'
end
#-------------------------------------------------------------------------#
......@@ -510,7 +510,7 @@ module Pod
l.include?('note: ') && (l !~ /expanded from macro/)
end
selected_lines.map do |l|
new = l.gsub(%r{/tmp/CocoaPods/Lint/Pods/}, '')
new = l.gsub(%r{#{validation_dir}/Pods/}, '')
new.gsub!(/^ */, ' ')
end
end
......
......@@ -72,7 +72,7 @@ module Pod
end
it 'does not update non-git repositories' do
tmp_directory = '/private/tmp/CocoaPods/'
tmp_directory = Pathname(Dir.tmpdir) + 'CocoaPods'
FileUtils.mkdir_p(tmp_directory)
FileUtils.cp_r(ROOT + 'spec/fixtures/spec-repos/test_repo/', tmp_directory)
non_git_repo = tmp_directory + 'test_repo'
......
......@@ -88,7 +88,7 @@ module Pod
validator.quick = true
validator.stubs(:validate_url)
validator.validate
validator.validation_dir.should.be == Pathname.new('/private/tmp/CocoaPods/Lint')
validator.validation_dir.should.be == Pathname.new(ENV['TMPDIR']) + 'CocoaPods/Lint'
end
end
......
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