Class: PodSpecBuilder
- Inherits:
-
Object
- Object
- PodSpecBuilder
- Defined in:
- lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
writeonly
Sets the attribute author.
-
#dependencies ⇒ Object
writeonly
Sets the attribute dependencies.
-
#description ⇒ Object
writeonly
Sets the attribute description.
-
#homepage ⇒ Object
writeonly
Sets the attribute homepage.
-
#license ⇒ Object
writeonly
Sets the attribute license.
-
#name ⇒ Object
writeonly
Sets the attribute name.
-
#platform ⇒ Object
writeonly
Sets the attribute platform.
-
#resources ⇒ Object
writeonly
Sets the attribute resources.
-
#source ⇒ Object
writeonly
Sets the attribute source.
-
#source_files ⇒ Object
writeonly
Sets the attribute source_files.
-
#spm_local_dependencies ⇒ Object
writeonly
Sets the attribute spm_local_dependencies.
-
#static_framework ⇒ Object
writeonly
Sets the attribute static_framework.
-
#subspecs ⇒ Object
writeonly
Sets the attribute subspecs.
-
#summary ⇒ Object
writeonly
Sets the attribute summary.
-
#swift_version ⇒ Object
writeonly
Sets the attribute swift_version.
-
#vendored_frameworks ⇒ Object
writeonly
Sets the attribute vendored_frameworks.
-
#version ⇒ Object
writeonly
Sets the attribute version.
Instance Method Summary collapse
- #add_dependency(name, version = nil) ⇒ Object
- #add_subspec(name, local_files, dependencies) ⇒ Object
- #build_pod_spec_string ⇒ Object
-
#initialize ⇒ PodSpecBuilder
constructor
A new instance of PodSpecBuilder.
Constructor Details
#initialize ⇒ PodSpecBuilder
Returns a new instance of PodSpecBuilder.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 23 def initialize @version = nil @summary = nil @author = nil @homepage = nil @platform = nil @name = nil @dependencies = [] @subscpecs = [] @resources = nil @source = nil @source_files = nil @swift_version = nil @source_files = nil @source = nil @spm_local_dependencies = [] @static_framework = false @vendored_frameworks = nil end |
Instance Attribute Details
#author=(value) ⇒ Object (writeonly)
Sets the attribute author
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def (value) @author = value end |
#dependencies=(value) ⇒ Object (writeonly)
Sets the attribute dependencies
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def dependencies=(value) @dependencies = value end |
#description=(value) ⇒ Object (writeonly)
Sets the attribute description
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def description=(value) @description = value end |
#homepage=(value) ⇒ Object (writeonly)
Sets the attribute homepage
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def homepage=(value) @homepage = value end |
#license=(value) ⇒ Object (writeonly)
Sets the attribute license
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def license=(value) @license = value end |
#name=(value) ⇒ Object (writeonly)
Sets the attribute name
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def name=(value) @name = value end |
#platform=(value) ⇒ Object (writeonly)
Sets the attribute platform
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def platform=(value) @platform = value end |
#resources=(value) ⇒ Object (writeonly)
Sets the attribute resources
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def resources=(value) @resources = value end |
#source=(value) ⇒ Object (writeonly)
Sets the attribute source
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def source=(value) @source = value end |
#source_files=(value) ⇒ Object (writeonly)
Sets the attribute source_files
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def source_files=(value) @source_files = value end |
#spm_local_dependencies=(value) ⇒ Object (writeonly)
Sets the attribute spm_local_dependencies
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def spm_local_dependencies=(value) @spm_local_dependencies = value end |
#static_framework=(value) ⇒ Object (writeonly)
Sets the attribute static_framework
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def static_framework=(value) @static_framework = value end |
#subspecs=(value) ⇒ Object (writeonly)
Sets the attribute subspecs
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def subspecs=(value) @subspecs = value end |
#summary=(value) ⇒ Object (writeonly)
Sets the attribute summary
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def summary=(value) @summary = value end |
#swift_version=(value) ⇒ Object (writeonly)
Sets the attribute swift_version
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def swift_version=(value) @swift_version = value end |
#vendored_frameworks=(value) ⇒ Object (writeonly)
Sets the attribute vendored_frameworks
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def vendored_frameworks=(value) @vendored_frameworks = value end |
#version=(value) ⇒ Object (writeonly)
Sets the attribute version
4 5 6 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4 def version=(value) @version = value end |
Instance Method Details
#add_dependency(name, version = nil) ⇒ Object
55 56 57 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 55 def add_dependency(name, version = nil) @dependencies.append({:name=>name, :version=>version}) end |
#add_subspec(name, local_files, dependencies) ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 59 def add_subspec(name, local_files, dependencies) @subscpecs.append({ name:, local_files:, dependencies: }) end |
#build_pod_spec_string ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 43 def build_pod_spec_string [start_of_spec, podspec_content_setting_string, static_framework_string, vendored_frameworks_string, generate_dependencies(@dependencies), subscpecs_string, generate_local_spm_dependencies(@spm_local_dependencies), end_of_spec ].compact.reject { |s| s.empty? }.join("\n") end |