Class: Pod::Command::Spec::Which

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

Overview

———————————————————————–#

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pod::Command

parse, report_error, run

Methods included from Pod::Config::Mixin

#config

Constructor Details

#initialize(argv) ⇒ Which

Returns a new instance of Which.



131
132
133
134
135
136
# File 'lib/cocoapods/command/spec.rb', line 131

def initialize(argv)
  @show_all = argv.flag?('show-all')
  @spec = argv.shift_argument
  @spec = @spec.gsub('.podspec', '') unless @spec.nil?
  super
end

Class Method Details

.optionsObject



127
128
129
# File 'lib/cocoapods/command/spec.rb', line 127

def self.options
  [["--show-all", "Print all versions of the given podspec"]].concat(super)
end

Instance Method Details

#runObject



143
144
145
# File 'lib/cocoapods/command/spec.rb', line 143

def run
  UI.puts get_path_of_spec(@spec, @show_all)
end

#validate!Object



138
139
140
141
# File 'lib/cocoapods/command/spec.rb', line 138

def validate!
  super
  help! "A podspec name is required." unless @spec
end