Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
58be5c5e
Commit
58be5c5e
authored
Aug 01, 2013
by
Ian Ynda-Hummel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up config/sources manager interfaces to not be polluted with old directory structure stuff.
parent
3d0d6edd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
21 deletions
+5
-21
setup.rb
lib/cocoapods/command/setup.rb
+3
-3
config.rb
lib/cocoapods/config.rb
+0
-9
sources_manager.rb
lib/cocoapods/sources_manager.rb
+0
-6
setup_spec.rb
spec/functional/command/setup_spec.rb
+2
-3
No files found.
lib/cocoapods/command/setup.rb
View file @
58be5c5e
...
@@ -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
...
...
lib/cocoapods/config.rb
View file @
58be5c5e
...
@@ -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.
#
#
...
...
lib/cocoapods/sources_manager.rb
View file @
58be5c5e
...
@@ -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
...
...
spec/functional/command/setup_spec.rb
View file @
58be5c5e
...
@@ -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?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment