class Pod::Command::Jyanalyzer::List

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/cocoapods-jyanalyzer/command/jyanalyzer/list.rb, line 17
def initialize(argv)
  @pods = argv.arguments!
  super
end

Public Instance Methods

recursion_dependencies(pod_targets) click to toggle source
# File lib/cocoapods-jyanalyzer/command/jyanalyzer/list.rb, line 43
def recursion_dependencies(pod_targets)
  text = {}
  dependent_targets = pod_targets
  dependent_targets.each do |item|
      text[item.pod_name]=item.version
  end
  return text

end
run() click to toggle source
# File lib/cocoapods-jyanalyzer/command/jyanalyzer/list.rb, line 21
def run

  verify_podfile_exists!
  installer = installer_for_config
  installer.repo_update = repo_update?(:default => true)
  UI.puts 'Update all pods'.yellow
  installer.update = true
  installer.prepare
  installer.resolve_dependencies
  pod_targets = installer.pod_targets;

  Pod::UI.puts '查看app依赖库名列表,pod jyanalyzer list'

  text = recursion_dependencies(pod_targets)
  Pod::UI.puts text

  f=File.new("dependencies.json","w+")
  f.puts(JSON.pretty_generate(text))
  f.close

end