Class: Pod::Command::Dep

Inherits:
Pod::Command show all
Defined in:
lib/podfileDep/command/dep.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Dep

Returns a new instance of Dep.



21
22
23
24
25
26
27
# File 'lib/podfileDep/command/dep.rb', line 21

def initialize(argv)
  super
  puts "插件版本号: #{PodfileDep::VERSION}"
  @name = argv.option('name')
  @sort_count = argv.flag?('sort', false)
  @forward = argv.flag?('forward', false)
end

Class Method Details

.optionsObject



13
14
15
16
17
18
19
# File 'lib/podfileDep/command/dep.rb', line 13

def self.options
  [
    %w[--name=xx xx为要查询的组件的名字],
    %w[--sort 输出依赖时按数量从小到大排序],
    %w[--forward 输出正向依赖],
  ].concat(super).reject { |(name, _)| (name == '--no-ansi' or name == '--silent' or name == '--allow-root' or name == '--verbose') }
end

Instance Method Details

#runObject



29
30
31
32
33
34
35
36
# File 'lib/podfileDep/command/dep.rb', line 29

def run
  verify_lockfile_exists!
  finder = Pod::DepFinder.new
  finder.find_name = @name
  finder.sort_count = @sort_count
  finder.forward = @forward
  finder.find
end