Class: Pod::SPM::MacroFetcher

Inherits:
Object
  • Object
show all
Includes:
MacroConfigMixin
Defined in:
lib/cocoapods-spm/macro/fetcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MacroConfigMixin

#macro_dir, #macro_downloaded_dir, #macro_prebuilt_dir, #metadata, #metadata_path

Methods included from Config::SPMConfigMixin

#local_macro_pod?, #local_macro_pod_dir, #macro_pods, #spm_config

Methods included from Config::PodConfigMixin

#pod_config

Methods included from Config::ProjectConfigMixin

#project_config

Constructor Details

#initialize(options = {}) ⇒ MacroFetcher

Returns a new instance of MacroFetcher.



12
13
14
15
16
17
# File 'lib/cocoapods-spm/macro/fetcher.rb', line 12

def initialize(options = {})
  @name = options[:name]
  @specs_by_platform = options[:specs_by_platform]
  @can_cache = options[:can_cache]
  @podfile = Pod::Config.instance.podfile
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/cocoapods-spm/macro/fetcher.rb', line 10

def name
  @name
end

Instance Method Details

#runObject



19
20
21
22
23
24
25
26
27
28
# File 'lib/cocoapods-spm/macro/fetcher.rb', line 19

def run
  prepare_macro_source
  macro_dir = spm_config.macro_root_dir / name
  macro_downloaded_dir = spm_config.macro_downloaded_root_dir / name
  FileUtils.copy_entry(
    macro_downloaded_dir / "Sources" / name,
    macro_dir / "Sources" / name
  )
  
end