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
5d9d15ea
Commit
5d9d15ea
authored
Sep 11, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2184 from CocoaPods/config-project-directory
[Command] Add option to configure project directory
parents
88742dd0
3164786c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
13 deletions
+52
-13
CHANGELOG.md
CHANGELOG.md
+5
-0
command.rb
lib/cocoapods/command.rb
+4
-2
project.rb
lib/cocoapods/command/project.rb
+33
-1
outdated_spec.rb
spec/functional/command/outdated_spec.rb
+4
-4
project_spec.rb
spec/functional/command/project_spec.rb
+6
-6
No files found.
CHANGELOG.md
View file @
5d9d15ea
...
@@ -59,6 +59,11 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
...
@@ -59,6 +59,11 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[
Fabio Pelosin
][
FabioPelosin
]
[
Fabio Pelosin
][
FabioPelosin
]
[
Eloy Durán
](
https://github.com/alloy
)
[
Eloy Durán
](
https://github.com/alloy
)
*
Add support for user-specified project directories with the
`--project-directory`
option
[
Samuel Giddins
](
segiddins
)
[
#2183
](
https://github.com/CocoaPods/CocoaPods/issues/2183
)
##### Bug Fixes
##### Bug Fixes
*
Fixed pod repo push to first check if Specs directory exists and if so push
*
Fixed pod repo push to first check if Specs directory exists and if so push
...
...
lib/cocoapods/command.rb
View file @
5d9d15ea
...
@@ -27,6 +27,8 @@ module Pod
...
@@ -27,6 +27,8 @@ module Pod
self
.
description
=
'CocoaPods, the Objective-C library package manager.'
self
.
description
=
'CocoaPods, the Objective-C library package manager.'
self
.
plugin_prefix
=
'cocoapods'
self
.
plugin_prefix
=
'cocoapods'
[
Install
,
Update
,
Outdated
,
IPC
::
Podfile
,
IPC
::
Repl
].
each
{
|
c
|
c
.
send
(
:include
,
ProjectDirectory
)
}
def
self
.
options
def
self
.
options
[
[
[
'--silent'
,
'Show nothing'
],
[
'--silent'
,
'Show nothing'
],
...
@@ -97,7 +99,7 @@ module Pod
...
@@ -97,7 +99,7 @@ module Pod
#
#
def
verify_podfile_exists!
def
verify_podfile_exists!
unless
config
.
podfile
unless
config
.
podfile
raise
Informative
,
"No `Podfile' found in the
current working
directory."
raise
Informative
,
"No `Podfile' found in the
project
directory."
end
end
end
end
...
@@ -109,7 +111,7 @@ module Pod
...
@@ -109,7 +111,7 @@ module Pod
#
#
def
verify_lockfile_exists!
def
verify_lockfile_exists!
unless
config
.
lockfile
unless
config
.
lockfile
raise
Informative
,
"No `Podfile.lock' found in the
current working
directory, run `pod install'."
raise
Informative
,
"No `Podfile.lock' found in the
project
directory, run `pod install'."
end
end
end
end
end
end
...
...
lib/cocoapods/command/project.rb
View file @
5d9d15ea
module
Pod
module
Pod
class
Command
class
Command
# Provides support the common behaviour of the `install` and `update`
# Provides support for commands to take a user-specified `project directory`
#
module
ProjectDirectory
module
Options
def
options
[
[
'--project-directory=/path/to/project/directory/'
,
'The path to the root of the project directory'
],
].
concat
(
super
)
end
end
def
self
.
included
(
base
)
base
.
extend
(
Options
)
end
def
initialize
(
argv
)
if
project_directory
=
argv
.
option
(
'project-directory'
)
@project_directory
=
Pathname
.
new
(
project_directory
).
expand_path
end
config
.
installation_root
=
@project_directory
super
end
def
validate!
super
if
@project_directory
&&
!
@project_directory
.
directory?
raise
Informative
,
"`
#{
@project_directory
}
` is not a valid directory."
end
end
end
# Provides support for the common behaviour of the `install` and `update`
# commands.
# commands.
#
#
module
Project
module
Project
...
...
spec/functional/command/outdated_spec.rb
View file @
5d9d15ea
...
@@ -4,17 +4,17 @@ module Pod
...
@@ -4,17 +4,17 @@ module Pod
describe
Command
::
Outdated
do
describe
Command
::
Outdated
do
extend
SpecHelper
::
TemporaryRepos
extend
SpecHelper
::
TemporaryRepos
it
'tells the user that no Podfile was found in the
current working
dir'
do
it
'tells the user that no Podfile was found in the
project
dir'
do
exception
=
lambda
{
run_command
(
'outdated'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
=
lambda
{
run_command
(
'outdated'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the
current working
directory."
exception
.
message
.
should
.
include
"No `Podfile' found in the
project
directory."
end
end
it
'tells the user that no Lockfile was found in the
current working
dir'
do
it
'tells the user that no Lockfile was found in the
project
dir'
do
file
=
temporary_directory
+
'Podfile'
file
=
temporary_directory
+
'Podfile'
File
.
open
(
file
,
'w'
)
{
|
f
|
f
.
write
(
'platform :ios'
)
}
File
.
open
(
file
,
'w'
)
{
|
f
|
f
.
write
(
'platform :ios'
)
}
Dir
.
chdir
(
temporary_directory
)
do
Dir
.
chdir
(
temporary_directory
)
do
exception
=
lambda
{
run_command
(
'outdated'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
=
lambda
{
run_command
(
'outdated'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile.lock' found in the
current working
directory"
exception
.
message
.
should
.
include
"No `Podfile.lock' found in the
project
directory"
end
end
end
end
...
...
spec/functional/command/project_spec.rb
View file @
5d9d15ea
...
@@ -14,9 +14,9 @@ module Pod
...
@@ -14,9 +14,9 @@ module Pod
describe
Command
::
Install
do
describe
Command
::
Install
do
it
'tells the user that no Podfile or podspec was found in the
current working
dir'
do
it
'tells the user that no Podfile or podspec was found in the
project
dir'
do
exception
=
lambda
{
run_command
(
'install'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
=
lambda
{
run_command
(
'install'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the
current working
directory."
exception
.
message
.
should
.
include
"No `Podfile' found in the
project
directory."
end
end
end
end
...
@@ -26,12 +26,12 @@ module Pod
...
@@ -26,12 +26,12 @@ module Pod
describe
Command
::
Update
do
describe
Command
::
Update
do
extend
SpecHelper
::
TemporaryRepos
extend
SpecHelper
::
TemporaryRepos
it
'tells the user that no Podfile was found in the
current working
dir'
do
it
'tells the user that no Podfile was found in the
project
dir'
do
exception
=
lambda
{
run_command
(
'update'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
=
lambda
{
run_command
(
'update'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the
current working
directory."
exception
.
message
.
should
.
include
"No `Podfile' found in the
project
directory."
end
end
it
'tells the user that no Lockfile was found in the
current working
dir'
do
it
'tells the user that no Lockfile was found in the
project
dir'
do
file
=
temporary_directory
+
'Podfile'
file
=
temporary_directory
+
'Podfile'
File
.
open
(
file
,
'w'
)
do
|
f
|
File
.
open
(
file
,
'w'
)
do
|
f
|
f
.
puts
(
'platform :ios'
)
f
.
puts
(
'platform :ios'
)
...
@@ -39,7 +39,7 @@ module Pod
...
@@ -39,7 +39,7 @@ module Pod
end
end
Dir
.
chdir
(
temporary_directory
)
do
Dir
.
chdir
(
temporary_directory
)
do
exception
=
lambda
{
run_command
(
'update'
,
'Reachability'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
=
lambda
{
run_command
(
'update'
,
'Reachability'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile.lock' found in the
current working
directory"
exception
.
message
.
should
.
include
"No `Podfile.lock' found in the
project
directory"
end
end
end
end
...
...
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