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
368f89ea
Commit
368f89ea
authored
Mar 12, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Command] Move ProjectDirectory into dedicated file
parent
b31abc36
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
36 deletions
+49
-36
command.rb
lib/cocoapods/command.rb
+3
-2
inter_process_communication.rb
lib/cocoapods/command/inter_process_communication.rb
+4
-0
project_directory.rb
lib/cocoapods/command/options/project_directory.rb
+36
-0
outdated.rb
lib/cocoapods/command/outdated.rb
+2
-0
project.rb
lib/cocoapods/command/project.rb
+4
-34
No files found.
lib/cocoapods/command.rb
View file @
368f89ea
...
@@ -14,6 +14,9 @@ module Pod
...
@@ -14,6 +14,9 @@ module Pod
end
end
class
Command
<
CLAide
::
Command
class
Command
<
CLAide
::
Command
require
'cocoapods/command/options/project_directory'
include
Options
require
'cocoapods/command/inter_process_communication'
require
'cocoapods/command/inter_process_communication'
require
'cocoapods/command/lib'
require
'cocoapods/command/lib'
require
'cocoapods/command/list'
require
'cocoapods/command/list'
...
@@ -32,8 +35,6 @@ module Pod
...
@@ -32,8 +35,6 @@ module Pod
self
.
description
=
'CocoaPods, the Cocoa library package manager.'
self
.
description
=
'CocoaPods, the Cocoa library package manager.'
self
.
plugin_prefixes
=
%w(claide cocoapods)
self
.
plugin_prefixes
=
%w(claide 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'
],
...
...
lib/cocoapods/command/inter_process_communication.rb
View file @
368f89ea
...
@@ -37,6 +37,8 @@ module Pod
...
@@ -37,6 +37,8 @@ module Pod
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
class
Podfile
<
IPC
class
Podfile
<
IPC
include
ProjectDirectory
self
.
summary
=
'Converts a Podfile to YAML'
self
.
summary
=
'Converts a Podfile to YAML'
self
.
description
=
'Converts a Podfile to YAML and prints it to STDOUT.'
self
.
description
=
'Converts a Podfile to YAML and prints it to STDOUT.'
self
.
arguments
=
[
self
.
arguments
=
[
...
@@ -123,6 +125,8 @@ module Pod
...
@@ -123,6 +125,8 @@ module Pod
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
class
Repl
<
IPC
class
Repl
<
IPC
include
ProjectDirectory
END_OF_OUTPUT_SIGNAL
=
"
\n\r
"
END_OF_OUTPUT_SIGNAL
=
"
\n\r
"
self
.
summary
=
'The repl listens to commands on standard input'
self
.
summary
=
'The repl listens to commands on standard input'
...
...
lib/cocoapods/command/options/project_directory.rb
0 → 100644
View file @
368f89ea
module
Pod
class
Command
module
Options
# Provides support for commands to take a user-specified `project directory`
#
module
ProjectDirectory
module
Options
def
options
[
[
'--project-directory=/project/dir/'
,
'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
end
end
end
lib/cocoapods/command/outdated.rb
View file @
368f89ea
module
Pod
module
Pod
class
Command
class
Command
class
Outdated
<
Command
class
Outdated
<
Command
include
ProjectDirectory
self
.
summary
=
'Show outdated project dependencies'
self
.
summary
=
'Show outdated project dependencies'
self
.
description
=
<<-
DESC
self
.
description
=
<<-
DESC
...
...
lib/cocoapods/command/project.rb
View file @
368f89ea
module
Pod
module
Pod
class
Command
class
Command
# Provides support for commands to take a user-specified `project directory`
#
module
ProjectDirectory
module
Options
def
options
[
[
'--project-directory=/project/dir/'
,
'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
#-------------------------------------------------------------------------#
class
Install
<
Command
class
Install
<
Command
include
ProjectDirectory
self
.
summary
=
'Install project dependencies to Podfile.lock versions'
self
.
summary
=
'Install project dependencies to Podfile.lock versions'
self
.
description
=
<<-
DESC
self
.
description
=
<<-
DESC
...
@@ -76,6 +44,8 @@ module Pod
...
@@ -76,6 +44,8 @@ module Pod
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
class
Update
<
Command
class
Update
<
Command
include
ProjectDirectory
self
.
summary
=
'Update outdated project dependencies and create new '
\
self
.
summary
=
'Update outdated project dependencies and create new '
\
'Podfile.lock'
'Podfile.lock'
...
...
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