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