Class: Pod::Command::Spec::Cat
- Inherits:
-
Pod::Command::Spec
- Object
- CLAide::Command
- Pod::Command
- Pod::Command::Spec
- Pod::Command::Spec::Cat
- Defined in:
- lib/cocoapods/command/spec.rb
Overview
———————————————————————–#
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Cat
constructor
A new instance of Cat.
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Pod::Command
parse, report_error, run, verify_git_version!
Methods included from Pod::Config::Mixin
Constructor Details
#initialize(argv) ⇒ Cat
Returns a new instance of Cat.
202 203 204 205 206 207 |
# File 'lib/cocoapods/command/spec.rb', line 202 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
.options ⇒ Object
198 199 200 |
# File 'lib/cocoapods/command/spec.rb', line 198 def self. [['--show-all', 'Pick from all versions of the given podspec']].concat(super) end |
Instance Method Details
#run ⇒ Object
214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/cocoapods/command/spec.rb', line 214 def run filepath = if @show_all specs = get_path_of_spec(@spec, @show_all).split(/\n/) index = choose_from_array(specs, "Which spec would you like to print [1-#{ specs.count }]? ") specs[index] else get_path_of_spec(@spec) end UI.puts File.read(filepath) end |
#validate! ⇒ Object
209 210 211 212 |
# File 'lib/cocoapods/command/spec.rb', line 209 def validate! super help! 'A podspec name is required.' unless @spec end |