Class: Pod::Command::Dep

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Dep

Returns a new instance of Dep.



17
18
19
20
21
22
23
# File 'lib/core_blur/command/dep.rb', line 17

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



10
11
12
13
14
15
16
# File 'lib/core_blur/command/dep.rb', line 10

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



24
25
26
27
28
29
30
31
# File 'lib/core_blur/command/dep.rb', line 24

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