Class: Pod::Command::IPC::Spec

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

Instance Method Summary collapse

Methods inherited from Pod::Command::IPC

#output_pipe

Methods inherited from Pod::Command

#ensure_master_spec_repo_exists!, options, report_error, run

Methods included from Pod::Config::Mixin

#config

Constructor Details

#initialize(argv) ⇒ Spec

Returns a new instance of Spec.



11
12
13
14
# File 'lib/cocoapods/command/ipc/spec.rb', line 11

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

Instance Method Details

#runObject



21
22
23
24
25
# File 'lib/cocoapods/command/ipc/spec.rb', line 21

def run
  require 'json'
  spec = Specification.from_file(@path)
  output_pipe.puts(spec.to_pretty_json)
end

#validate!Object



16
17
18
19
# File 'lib/cocoapods/command/ipc/spec.rb', line 16

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