Class: Pod::SPM::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-spm/config.rb

Defined Under Namespace

Modules: Mixin

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



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

def initialize
  @dsl_config = {
    :dont_prebuild_macros => false,
    :dont_prebuild_macros_if_exist => true
  }
  @cli_config = {}
end

Instance Attribute Details

#cli_configObject

Returns the value of attribute cli_config.



14
15
16
# File 'lib/cocoapods-spm/config.rb', line 14

def cli_config
  @cli_config
end

#dsl_configObject

Returns the value of attribute dsl_config.



14
15
16
# File 'lib/cocoapods-spm/config.rb', line 14

def dsl_config
  @dsl_config
end

Class Method Details

.instanceObject



24
25
26
# File 'lib/cocoapods-spm/config.rb', line 24

def self.instance
  @instance ||= Config.new
end

Instance Method Details

#all_macrosObject



44
45
46
# File 'lib/cocoapods-spm/config.rb', line 44

def all_macros
  @all_macros ||= Pod::Config.instance.podfile.macro_pods.keys
end

#dont_prebuild_macros?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/cocoapods-spm/config.rb', line 32

def dont_prebuild_macros?
  merged_config[:dont_prebuild_macros]
end

#dont_prebuild_macros_if_exist?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/cocoapods-spm/config.rb', line 36

def dont_prebuild_macros_if_exist?
  merged_config[:dont_prebuild_macros_if_exist]
end

#macro_configObject



40
41
42
# File 'lib/cocoapods-spm/config.rb', line 40

def macro_config
  merged_config[:config] || merged_config[:default_macro_config] || "debug"
end

#macro_downloaded_root_dirObject



56
57
58
# File 'lib/cocoapods-spm/config.rb', line 56

def macro_downloaded_root_dir
  macro_root_dir / ".downloaded"
end

#macro_downloaded_sandboxObject



60
61
62
# File 'lib/cocoapods-spm/config.rb', line 60

def macro_downloaded_sandbox
  @macro_downloaded_sandbox ||= Sandbox.new(macro_downloaded_root_dir)
end

#macro_root_dirObject



52
53
54
# File 'lib/cocoapods-spm/config.rb', line 52

def macro_root_dir
  @macro_root_dir ||= Pathname(".spm.pods")
end

#macrosObject



48
49
50
# File 'lib/cocoapods-spm/config.rb', line 48

def macros
  merged_config[:all] ? all_macros : (merged_config[:macros] || [])
end

#merged_configObject



28
29
30
# File 'lib/cocoapods-spm/config.rb', line 28

def merged_config
  @dsl_config.merge(@cli_config)
end