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

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

Constant Summary

Constants inherited from Pod::Command::Spm

Fetch, Prebuild

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pod::Command::Spm

bind_command, #update_cli_config

Methods included from SPM::Config::SPMConfigMixin

#macro_pods, #spm_config

Methods included from SPM::Config::PodConfigMixin

#pod_config

Methods included from SPM::Config::ProjectConfigMixin

#project_config

Constructor Details

#initialize(argv) ⇒ Fetch

Returns a new instance of Fetch.



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

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

Class Method Details

.optionsObject



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

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

Instance Method Details

#runObject



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

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