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
b95bb22c
Commit
b95bb22c
authored
Jun 06, 2017
by
dacaiguoguogmail
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ipc command `podfile_json` converts a Podfile to JSON
parent
0ad9a6ca
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 @
b95bb22c
...
...
@@ -32,6 +32,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Austin Emmons
](
https://github.com/atreat
)
[
#6742
](
https://github.com/CocoaPods/CocoaPods/issues/6742
)
*
Add ipc command
`podfile_json`
converts a Podfile to JSON
[
Dacaiguoguo
](
https://github.com/dacaiguoguogmail
)
[
#6779
](
https://github.com/CocoaPods/CocoaPods/pull/6779
)
##### Bug Fixes
*
Do not double add search paths to test xcconfig from parent
...
...
lib/cocoapods/command/ipc.rb
View file @
b95bb22c
require
'cocoapods/command/ipc/list'
require
'cocoapods/command/ipc/podfile'
require
'cocoapods/command/ipc/podfile_json'
require
'cocoapods/command/ipc/repl'
require
'cocoapods/command/ipc/spec'
require
'cocoapods/command/ipc/update_search_index'
...
...
lib/cocoapods/command/ipc/podfile_json.rb
0 → 100644
View file @
b95bb22c
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 @
b95bb22c
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