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, verify_git_version!

Methods included from Pod::Config::Mixin

#config

Constructor Details

#initialize(argv) ⇒ Which

Returns a new instance of Which.



168
169
170
171
172
173
# File 'lib/cocoapods/command/spec.rb', line 168

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



162
163
164
165
166
# File 'lib/cocoapods/command/spec.rb', line 162

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

Instance Method Details

#runObject



180
181
182
# File 'lib/cocoapods/command/spec.rb', line 180

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

#validate!Object



175
176
177
178
# File 'lib/cocoapods/command/spec.rb', line 175

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