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
86ccff79
Commit
86ccff79
authored
Jun 09, 2017
by
Dimitris Koutsogiorgas
Committed by
GitHub
Jun 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6779 from dacaiguoguogmail/master
Add ipc command `podfile_json` converts a Podfile to JSON
parents
85b7bde0
e98bee56
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
0 deletions
+50
-0
CHANGELOG.md
CHANGELOG.md
+4
-0
ipc.rb
lib/cocoapods/command/ipc.rb
+1
-0
podfile_json.rb
lib/cocoapods/command/ipc/podfile_json.rb
+30
-0
podfile_json_spec.rb
spec/functional/command/ipc/podfile_json_spec.rb
+15
-0
No files found.
CHANGELOG.md
View file @
86ccff79
...
@@ -45,6 +45,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -45,6 +45,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Austin Emmons
](
https://github.com/atreat
)
[
Austin Emmons
](
https://github.com/atreat
)
[
#6742
](
https://github.com/CocoaPods/CocoaPods/issues/6742
)
[
#6742
](
https://github.com/CocoaPods/CocoaPods/issues/6742
)
*
Add a ipc command
`podfile_json`
converts a Podfile to JSON
[
Dacaiguoguo
](
https://github.com/dacaiguoguogmail
)
[
#6779
](
https://github.com/CocoaPods/CocoaPods/pull/6779
)
##### Bug Fixes
##### Bug Fixes
*
Use a cache when figuring out if a pod target is test only
*
Use a cache when figuring out if a pod target is test only
...
...
lib/cocoapods/command/ipc.rb
View file @
86ccff79
require
'cocoapods/command/ipc/list'
require
'cocoapods/command/ipc/list'
require
'cocoapods/command/ipc/podfile'
require
'cocoapods/command/ipc/podfile'
require
'cocoapods/command/ipc/podfile_json'
require
'cocoapods/command/ipc/repl'
require
'cocoapods/command/ipc/repl'
require
'cocoapods/command/ipc/spec'
require
'cocoapods/command/ipc/spec'
require
'cocoapods/command/ipc/update_search_index'
require
'cocoapods/command/ipc/update_search_index'
...
...
lib/cocoapods/command/ipc/podfile_json.rb
0 → 100644
View file @
86ccff79
module
Pod
class
Command
class
IPC
<
Command
class
PodfileJSON
<
IPC
include
ProjectDirectory
self
.
summary
=
'Converts a Podfile to JSON'
self
.
description
=
'Converts a Podfile to JSON and prints it to STDOUT.'
self
.
arguments
=
[
CLAide
::
Argument
.
new
(
'PATH'
,
true
),
]
def
initialize
(
argv
)
@path
=
argv
.
shift_argument
super
end
def
validate!
super
help!
'A Podfile path is required.'
unless
@path
end
def
run
podfile
=
Pod
::
Podfile
.
from_file
(
@path
)
output_pipe
.
puts
podfile
.
to_hash
.
to_json
end
end
end
end
end
spec/functional/command/ipc/podfile_json_spec.rb
0 → 100644
View file @
86ccff79
require
File
.
expand_path
(
'../../../../spec_helper'
,
__FILE__
)
module
Pod
describe
Command
::
IPC
::
PodfileJSON
do
before
do
Command
::
IPC
::
PodfileJSON
.
any_instance
.
stubs
(
:output_pipe
).
returns
(
UI
)
end
it
'converts a Podfile to JSON and prints it to STDOUT'
do
out
=
run_command
(
'ipc'
,
'podfile-json'
,
fixture
(
'Podfile'
))
parsed_hash
=
JSON
.
parse
(
out
)
parsed_hash
.
should
==
{
'target_definitions'
=>
[{
'name'
=>
'Pods'
,
'abstract'
=>
true
,
'platform'
=>
'ios'
,
'dependencies'
=>
[{
'SSZipArchive'
=>
[
'>= 1'
]
},
{
'ASIHTTPRequest'
=>
[
'~> 1.8.0'
]
},
'Reachability'
,
{
'ASIWebPageRequest'
=>
[
'< 1.8.2'
]
}]
}]
}
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