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
b364b059
Commit
b364b059
authored
Sep 25, 2014
by
Eloy Durán
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[pod init] Set `source` directive to use `master` repo URL.
parent
d90c9545
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
init.rb
lib/cocoapods/command/init.rb
+1
-1
setup.rb
lib/cocoapods/command/setup.rb
+4
-4
setup_spec.rb
spec/functional/command/setup_spec.rb
+3
-3
No files found.
lib/cocoapods/command/init.rb
View file @
b364b059
...
@@ -59,7 +59,7 @@ module Pod
...
@@ -59,7 +59,7 @@ module Pod
# Uncomment this line to define a global platform for your project
# Uncomment this line to define a global platform for your project
# platform :ios, "6.0"
# platform :ios, "6.0"
source '
master
'
source '
#{
Command
::
Setup
.
read_only_url
}
'
PLATFORM
PLATFORM
project
.
targets
.
each
do
|
target
|
project
.
targets
.
each
do
|
target
|
...
...
lib/cocoapods/command/setup.rb
View file @
b364b059
...
@@ -116,18 +116,18 @@ module Pod
...
@@ -116,18 +116,18 @@ module Pod
# be enabled.
# be enabled.
#
#
def
url
def
url
push?
?
read_write_url
:
read_only_url
push?
?
self
.
class
.
read_write_url
:
self
.
class
.
read_only_url
end
end
# @return [String] the read only url of the master repo.
# @return [String] the read only url of the master repo.
#
#
def
read_only_url
def
self
.
read_only_url
'https://github.com/CocoaPods/Specs.git'
'https://github.com/CocoaPods/Specs.git'
end
end
# @return [String] the read-write url of the master repo.
# @return [String] the read-write url of the master repo.
#
#
def
read_write_url
def
self
.
read_write_url
'git@github.com:CocoaPods/Specs.git'
'git@github.com:CocoaPods/Specs.git'
end
end
...
@@ -146,7 +146,7 @@ module Pod
...
@@ -146,7 +146,7 @@ module Pod
return
false
unless
master_repo_dir
.
exist?
return
false
unless
master_repo_dir
.
exist?
Dir
.
chdir
(
master_repo_dir
)
do
Dir
.
chdir
(
master_repo_dir
)
do
url
=
git
(
'config --get remote.origin.url'
)
url
=
git
(
'config --get remote.origin.url'
)
url
.
chomp
==
read_write_url
url
.
chomp
==
self
.
class
.
read_write_url
end
end
end
end
...
...
spec/functional/command/setup_spec.rb
View file @
b364b059
...
@@ -23,7 +23,7 @@ module Pod
...
@@ -23,7 +23,7 @@ module Pod
before
do
before
do
set_up_test_repo
set_up_test_repo
Command
::
Setup
.
any_instance
.
stubs
(
:read_only_url
).
returns
(
test_repo_path
.
to_s
)
Command
::
Setup
.
stubs
(
:read_only_url
).
returns
(
test_repo_path
.
to_s
)
config
.
repos_dir
=
SpecHelper
.
temporary_directory
config
.
repos_dir
=
SpecHelper
.
temporary_directory
end
end
...
@@ -44,7 +44,7 @@ module Pod
...
@@ -44,7 +44,7 @@ module Pod
`echo 'touch' > touch && git add touch && git commit -m 'updated'`
`echo 'touch' > touch && git add touch && git commit -m 'updated'`
end
end
# Need to use file:// to test local use of --depth=1
# Need to use file:// to test local use of --depth=1
Command
::
Setup
.
any_instance
.
stubs
(
:read_only_url
).
returns
(
"file://
#{
test_repo_path
}
"
)
Command
::
Setup
.
stubs
(
:read_only_url
).
returns
(
"file://
#{
test_repo_path
}
"
)
run_command
(
'setup'
)
run_command
(
'setup'
)
Dir
.
chdir
(
config
.
repos_dir
+
'master'
)
do
Dir
.
chdir
(
config
.
repos_dir
+
'master'
)
do
`git log --pretty=oneline`
.
strip
.
split
(
"
\n
"
).
size
.
should
==
1
`git log --pretty=oneline`
.
strip
.
split
(
"
\n
"
).
size
.
should
==
1
...
@@ -66,7 +66,7 @@ module Pod
...
@@ -66,7 +66,7 @@ module Pod
`echo 'touch' > touch && git add touch && git commit -m 'updated'`
`echo 'touch' > touch && git add touch && git commit -m 'updated'`
end
end
# Need to use file:// to test local use of --depth=1
# Need to use file:// to test local use of --depth=1
Command
::
Setup
.
any_instance
.
stubs
(
:read_write_url
).
returns
(
"file://
#{
test_repo_path
}
"
)
Command
::
Setup
.
stubs
(
:read_write_url
).
returns
(
"file://
#{
test_repo_path
}
"
)
cmd
=
run_command
(
'setup'
,
'--push'
)
cmd
=
run_command
(
'setup'
,
'--push'
)
Dir
.
chdir
(
config
.
repos_dir
+
'master'
)
do
Dir
.
chdir
(
config
.
repos_dir
+
'master'
)
do
`git log --pretty=oneline`
.
strip
.
split
(
"
\n
"
).
size
.
should
>
1
`git log --pretty=oneline`
.
strip
.
split
(
"
\n
"
).
size
.
should
>
1
...
...
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