Class: MBuildConfig

Inherits:
Object show all
Includes:
Singleton
Defined in:
lib/cocoapods-podspec-binary/config/mbuild_config.rb

Overview

Plugin configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMBuildConfig



13
14
15
16
# File 'lib/cocoapods-podspec-binary/config/mbuild_config.rb', line 13

def initialize
  @root_dir = Dir.pwd
  @mbuild_dir = File.join(Dir.home, '.mbuild')
end

Instance Attribute Details

#library_typeObject

Returns the value of attribute library_type.



11
12
13
# File 'lib/cocoapods-podspec-binary/config/mbuild_config.rb', line 11

def library_type
  @library_type
end

#mbuild_dirObject (readonly)

Returns the value of attribute mbuild_dir.



10
11
12
# File 'lib/cocoapods-podspec-binary/config/mbuild_config.rb', line 10

def mbuild_dir
  @mbuild_dir
end

#pod_nameObject

Returns the value of attribute pod_name.



11
12
13
# File 'lib/cocoapods-podspec-binary/config/mbuild_config.rb', line 11

def pod_name
  @pod_name
end

#pod_versionObject

Returns the value of attribute pod_version.



11
12
13
# File 'lib/cocoapods-podspec-binary/config/mbuild_config.rb', line 11

def pod_version
  @pod_version
end

#root_dirObject (readonly)

Returns the value of attribute root_dir.



10
11
12
# File 'lib/cocoapods-podspec-binary/config/mbuild_config.rb', line 10

def root_dir
  @root_dir
end

#sourcesObject

Returns the value of attribute sources.



11
12
13
# File 'lib/cocoapods-podspec-binary/config/mbuild_config.rb', line 11

def sources
  @sources
end

#swiftObject

Returns the value of attribute swift.



11
12
13
# File 'lib/cocoapods-podspec-binary/config/mbuild_config.rb', line 11

def swift
  @swift
end

Instance Method Details

#command_config(pod_name, pod_version) ⇒ Object



28
29
30
31
# File 'lib/cocoapods-podspec-binary/config/mbuild_config.rb', line 28

def command_config(pod_name, pod_version)
  @pod_name = pod_name
  @pod_version = pod_version
end

#load_configObject



18
19
20
21
22
23
24
25
26
# File 'lib/cocoapods-podspec-binary/config/mbuild_config.rb', line 18

def load_config
  mbuild_yml = File.join(@root_dir, '.mbuild.yml')
  return unless File.file?(mbuild_yml)

  mbuild_params = YAML.load_file(mbuild_yml)
  validate_required_config(mbuild_params, 'pod_name', 'pod_version')
  @pod_name = mbuild_params['program']['pod_name']
  @pod_version = mbuild_params['program']['pod_version']
end