Class: MBuildConfig
- Includes:
- Singleton
- Defined in:
- lib/cocoapods-podspec-binary/config/mbuild_config.rb
Overview
Plugin configuration
Instance Attribute Summary collapse
-
#library_type ⇒ Object
Returns the value of attribute library_type.
-
#mbuild_dir ⇒ Object
readonly
Returns the value of attribute mbuild_dir.
-
#pod_name ⇒ Object
Returns the value of attribute pod_name.
-
#pod_version ⇒ Object
Returns the value of attribute pod_version.
-
#root_dir ⇒ Object
readonly
Returns the value of attribute root_dir.
-
#sources ⇒ Object
Returns the value of attribute sources.
-
#swift ⇒ Object
Returns the value of attribute swift.
Instance Method Summary collapse
- #command_config(pod_name, pod_version) ⇒ Object
-
#initialize ⇒ MBuildConfig
constructor
A new instance of MBuildConfig.
- #load_config ⇒ Object
Constructor Details
#initialize ⇒ MBuildConfig
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_type ⇒ Object
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_dir ⇒ Object (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_name ⇒ Object
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_version ⇒ Object
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_dir ⇒ Object (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 |
#sources ⇒ Object
Returns the value of attribute sources.
11 12 13 |
# File 'lib/cocoapods-podspec-binary/config/mbuild_config.rb', line 11 def sources @sources end |
#swift ⇒ Object
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_config ⇒ Object
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 |