Commit 4d91b1e0 authored by Fabio Pelosin's avatar Fabio Pelosin

[Command::IPC] Convert Podfiles to YAML

parent 5efcdee9
...@@ -32,6 +32,31 @@ module Pod ...@@ -32,6 +32,31 @@ module Pod
#-----------------------------------------------------------------------# #-----------------------------------------------------------------------#
class Podfile < IPC
self.summary = 'Converts a Podfile to YAML.'
self.description = 'Converts a Podfile to YAML and prints it to STDOUT.'
self.arguments = 'PATH'
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)
UI.puts podfile.to_yaml
end
end
#-----------------------------------------------------------------------#
class List < IPC class List < IPC
self.summary = 'Lists the specifications know to CocoaPods.' self.summary = 'Lists the specifications know to CocoaPods.'
......
...@@ -17,6 +17,20 @@ module Pod ...@@ -17,6 +17,20 @@ module Pod
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
describe Command::IPC::Podfile do
it "converts a Podfile to yaml and prints it to STDOUT" do
out = run_command('ipc', 'podfile', fixture('Podfile'))
out.should.include('---')
out.should.match /target_definitions:/
out.should.match /platform: :ios/
out.should.match /- SSZipArchive:/
end
end
#-------------------------------------------------------------------------#
describe Command::IPC::List do describe Command::IPC::List do
it "converts a podspec to yaml and prints it to STDOUT" do it "converts a podspec to yaml and prints it to STDOUT" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment