Commit 58be5c5e authored by Ian Ynda-Hummel's avatar Ian Ynda-Hummel

Clean up config/sources manager interfaces to not be polluted with old directory structure stuff.

parent 3d0d6edd
......@@ -53,8 +53,8 @@ module Pod
# @return [void]
def migrate_repos
config.repos_dir.mkpath
Dir.foreach config.old_repos_dir do |repo_dir|
source_repo_dir = config.old_repos_dir + repo_dir
Dir.foreach old_master_repo_dir.parent do |repo_dir|
source_repo_dir = old_master_repo_dir.parent + repo_dir
target_repo_dir = config.repos_dir + repo_dir
if not repo_dir =~ /\.+/ and source_repo_dir != config.repos_dir
FileUtils.mv source_repo_dir, target_repo_dir
......@@ -152,7 +152,7 @@ module Pod
# @return [Pathname] the directory of the old master repo.
#
def old_master_repo_dir
SourcesManager.old_master_repo_dir
Pathname.new('~/.cocoapods/master').expand_path
end
end
end
......
......@@ -147,15 +147,6 @@ module Pod
attr_writer :repos_dir
# @return [Pathname] the deprecated directory where the CocoaPods sources
# were stored.
#
def old_repos_dir
@old_repos_dir ||= Pathname.new('~/.cocoapods').expand_path
end
attr_writer :old_repos_dir
# @return [Pathname] the root of the CocoaPods installation where the
# Podfile is located.
#
......
......@@ -259,12 +259,6 @@ module Pod
config.repos_dir + 'master'
end
# @return [Pathname] The path of the old master repo.
#
def old_master_repo_dir
config.old_repos_dir + 'master'
end
# @return [Bool] Checks if the master repo is usable.
#
# @note Note this is used to automatically setup the master repo if
......
......@@ -25,7 +25,6 @@ module Pod
set_up_test_repo
Command::Setup.any_instance.stubs(:read_only_url).returns(test_repo_path.to_s)
config.repos_dir = SpecHelper.temporary_directory
config.old_repos_dir = SpecHelper.temporary_directory + '..'
end
it "runs with correct parameters" do
......@@ -51,11 +50,11 @@ module Pod
FileUtils.rm_rf(test_repo_path)
set_up_old_test_repo
config.repos_dir = SpecHelper.temporary_directory + 'cocoapods/repos'
config.old_repos_dir = SpecHelper.temporary_directory + 'cocoapods'
Command::Setup.any_instance.stubs(:old_master_repo_dir).returns(SpecHelper.temporary_directory + 'cocoapods/master')
end
it "migrates repos from the old directory structure to the new one" do
source = config.old_repos_dir + 'master'
source = SpecHelper.temporary_directory + 'cocoapods/master'
target = config.repos_dir + 'master'
source.should.exist?
......
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