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
478ef3a6
Commit
478ef3a6
authored
Mar 06, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Command::IPC] Add repl subcommand
parent
93c28fca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
4 deletions
+82
-4
CHANGELOG.md
CHANGELOG.md
+4
-0
inter_process_communication.rb
lib/cocoapods/command/inter_process_communication.rb
+51
-3
inter_process_communication_spec.rb
spec/functional/command/inter_process_communication_spec.rb
+27
-1
No files found.
CHANGELOG.md
View file @
478ef3a6
...
...
@@ -11,6 +11,10 @@
OTHER_CPLUSPLUSFLAGS in the release builds of the Pods project.
-
Fixed
`pod lint --local`
###### Ancillary enhancements
-
Added
`pod ipc repl`
subcommand.
## 0.17.0.rc2
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.17.0.rc1...0.17.0.rc2
)
•
[
cocoapods-core
](
https://github.com/CocoaPods/Core/compare/0.17.0.rc1...0.17.0.rc2
)
...
...
lib/cocoapods/command/inter_process_communication.rb
View file @
478ef3a6
...
...
@@ -80,9 +80,7 @@ module Pod
begin
spec
=
set
.
specification
result
[
spec
.
name
]
=
{
'defined_in_file'
=>
spec
.
defined_in_file
.
to_s
,
'version'
=>
spec
.
version
,
'authors'
=>
spec
.
authors
,
'authors'
=>
spec
.
authors
.
keys
,
'summary'
=>
spec
.
summary
,
'description'
=>
spec
.
description
,
'platforms'
=>
spec
.
available_platforms
.
map
{
|
p
|
p
.
name
.
to_s
},
...
...
@@ -98,6 +96,56 @@ module Pod
#-----------------------------------------------------------------------#
class
Repl
<
IPC
LISTENING_STRING
=
'>>> @LISTENING <<<'
self
.
summary
=
'The repl listens to commands on standard input.'
self
.
description
=
<<-
DESC
The repl listens to commands on standard input and prints their
result to standard output.
It accepts all the other ipc subcommands. The repl will signal when
it is ready to receive a new command with the `
#{
LISTENING_STRING
}
`
string.
DESC
def
run
salute
listen
end
def
salute
UI
.
puts
"version:
#{
Pod
::
VERSION
}
"
end
def
listen
signal_ready
while
repl_command
=
STDIN
.
gets
execute_repl_command
(
repl_command
)
end
end
def
signal_ready
UI
.
puts
LISTENING_STRING
end
def
execute_repl_command
(
repl_command
)
if
(
repl_command
!=
"
\n
"
)
repl_commands
=
repl_command
.
split
subcommand
=
repl_commands
.
shift
.
capitalize
arguments
=
repl_commands
subcommand_class
=
Kernel
.
const_get
(
"Pod::Command::IPC::
#{
subcommand
}
"
)
subcommand_class
.
new
(
CLAide
::
ARGV
.
new
(
arguments
)).
run
signal_ready
STDOUT
.
flush
end
end
end
#-----------------------------------------------------------------------#
end
end
end
spec/functional/command/inter_process_communication_spec.rb
View file @
478ef3a6
...
...
@@ -42,7 +42,6 @@ module Pod
out
=
run_command
(
'ipc'
,
'list'
)
out
.
should
.
include
(
'---'
)
out
.
should
.
match
/BananaLib:/
out
.
should
.
match
/version: .1\.0./
out
.
should
.
match
/description: Full of chunky bananas./
end
...
...
@@ -50,5 +49,32 @@ module Pod
#-------------------------------------------------------------------------#
describe
Command
::
IPC
::
Repl
do
it
"prints the version of CocoaPods as its first message"
do
command
=
Command
::
IPC
::
Repl
.
new
(
CLAide
::
ARGV
.
new
([]))
command
.
stubs
(
:listen
)
command
.
run
out
=
UI
.
output
out
.
should
.
match
/version:
#{
Pod
::
VERSION
}
/
end
it
"converts forwards the commands to the other ipc subcommands prints the result to STDOUT"
do
command
=
Command
::
IPC
::
Repl
.
new
(
CLAide
::
ARGV
.
new
([]))
command
.
execute_repl_command
(
"podfile
#{
fixture
(
'Podfile'
)
}
"
)
out
=
UI
.
output
out
.
should
.
include
(
'---'
)
out
.
should
.
match
/target_definitions:/
out
.
should
.
match
/platform: ios/
out
.
should
.
match
/- SSZipArchive:/
out
.
should
.
match
/>>> @LISTENING <<<$/
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