Class: Pod::Command::IPC::PodfileJSON

Inherits:
Pod::Command::IPC show all
Includes:
ProjectDirectory
Defined in:
lib/cocoapods/command/ipc/podfile_json.rb

Instance Method Summary collapse

Methods inherited from Pod::Command::IPC

#output_pipe

Methods inherited from Pod::Command

#ensure_master_spec_repo_exists!, ensure_not_root_or_allowed!, git_version, #installer_for_config, options, report_error, run, #verify_lockfile_exists!, verify_minimum_git_version!, #verify_podfile_exists!, verify_xcode_license_approved!

Methods included from Pod::Config::Mixin

#config

Constructor Details

#initialize(argv) ⇒ PodfileJSON

Returns a new instance of PodfileJSON.



13
14
15
16
# File 'lib/cocoapods/command/ipc/podfile_json.rb', line 13

def initialize(argv)
  @path = argv.shift_argument
  super
end

Instance Method Details

#runObject



23
24
25
26
# File 'lib/cocoapods/command/ipc/podfile_json.rb', line 23

def run
  podfile = Pod::Podfile.from_file(@path)
  output_pipe.puts podfile.to_hash.to_json
end

#validate!Object



18
19
20
21
# File 'lib/cocoapods/command/ipc/podfile_json.rb', line 18

def validate!
  super
  help! 'A Podfile path is required.' unless @path
end