class Pod::Command::Dependmanager::List
Public Class Methods
new(argv)
click to toggle source
Calls superclass method
# File lib/cocoapods-dependManager/command/list.rb, line 18 def initialize(argv) @target = argv.option('target') @podfile_name = argv.option('podfile') super end
options()
click to toggle source
Calls superclass method
# File lib/cocoapods-dependManager/command/list.rb, line 11 def self.options [ ['--target=TARGET', 'list all dependencies in `TARGET`'], ['--podfile=PODFILE', 'podfile name, defalut Podfile'], ].concat(super) end
Public Instance Methods
print_target_dependencies(target_definition)
click to toggle source
# File lib/cocoapods-dependManager/command/list.rb, line 47 def print_target_dependencies(target_definition) UI.title "Target #{target_definition.name}" do target_definition.dependencies.each do |dependency| UI.puts "- #{dependency.to_s}" end end UI.puts "\n" end
run()
click to toggle source
# File lib/cocoapods-dependManager/command/list.rb, line 24 def run podfile_path = '' if @podfile_name podfile_path = Pathname.pwd + @podfile_name else podfile_path = Pathname.pwd + 'Podfile' end target_definitions = Podfile.from_file(podfile_path).target_definitions if @target unless target_definitions.has_key?(@target) help! 'The target is not exist' else print_target_dependencies(target_definitions[@target]) end else target_definitions.each do |name, definition| unless name == 'Pods' print_target_dependencies(definition) end end end end