Class: Pod::Command::Spm::Fetch

Inherits:
Pod::Command::Spm show all
Defined in:
lib/cocoapods-spm/command/fetch.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pod::Command::Spm

#update_cli_config

Methods included from SPM::Config::Mixin

#macro_pods, #spm_config

Constructor Details

#initialize(argv) ⇒ Fetch

Returns a new instance of Fetch.



15
16
17
18
19
20
21
# File 'lib/cocoapods-spm/command/fetch.rb', line 15

def initialize(argv)
  super
  update_cli_config(
    all: argv.flag?("all"),
    macros: argv.option("macros", "").split(",")
  )
end

Class Method Details

.optionsObject



8
9
10
11
12
13
# File 'lib/cocoapods-spm/command/fetch.rb', line 8

def self.options
  [
    ["--all", "Prebuild all macros"],
    ["--macros=foo", "Macros to prebuild, separated by comma (,)"],
  ].concat(super)
end

Instance Method Details

#runObject



23
24
25
26
27
# File 'lib/cocoapods-spm/command/fetch.rb', line 23

def run
  spm_config.macros.each do |name|
    SPM::MacroFetcher.new(name: name, can_cache: true).run
  end
end