Class: Pod::Command::Bin::Repo::Update

Inherits:
Repo
  • Object
show all
Defined in:
lib/cocoapods-bb-bin/command/bin/repo/update.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Update

Returns a new instance of Update.



20
21
22
23
24
# File 'lib/cocoapods-bb-bin/command/bin/repo/update.rb', line 20

def initialize(argv)
  @all = argv.flag?('all')
  @name = argv.shift_argument
  super
end

Class Method Details

.optionsObject



14
15
16
17
18
# File 'lib/cocoapods-bb-bin/command/bin/repo/update.rb', line 14

def self.options
  [
    ['--all', '更新所有私有源,默认只更新二进制相关私有源']
  ].concat(super)
end

Instance Method Details

#runObject



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/cocoapods-bb-bin/command/bin/repo/update.rb', line 26

def run
  show_output = !config.silent?
  if @name || @all
    config.sources_manager.update(@name, show_output)
  else
    puts "repo update valid_sources:#{valid_sources}"
    Parallel.each(valid_sources, in_threads: 4) do |source|
      UI.puts "更新私有源仓库 #{source.to_s}".yellow
      source.update(show_output)
    end
  end
end