Class: PodSpecBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePodSpecBuilder

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

Parameters:

  • value

    the value to set the attribute author to.



4
5
6
# File 'lib/fastlane/plugin/pod_spec_generator/helper/pod_spec_builder.rb', line 4

def author=(value)
  @author = value
end

#dependencies=(value) ⇒ Object (writeonly)

Sets the attribute dependencies

Parameters:

  • value

    the value to set the attribute dependencies to.



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

Parameters:

  • value

    the value to set the attribute description to.



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

Parameters:

  • value

    the value to set the attribute homepage to.



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

Parameters:

  • value

    the value to set the attribute license to.



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

Parameters:

  • value

    the value to set the attribute name to.



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

Parameters:

  • value

    the value to set the attribute platform to.



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

Parameters:

  • value

    the value to set the attribute resources to.



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

Parameters:

  • value

    the value to set the attribute source to.



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

Parameters:

  • value

    the value to set the attribute source_files to.



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

Parameters:

  • value

    the value to set the attribute spm_local_dependencies to.



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

Parameters:

  • value

    the value to set the attribute static_framework to.



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

Parameters:

  • value

    the value to set the attribute subspecs to.



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

Parameters:

  • value

    the value to set the attribute summary to.



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

Parameters:

  • value

    the value to set the attribute swift_version to.



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

Parameters:

  • value

    the value to set the attribute vendored_frameworks to.



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

Parameters:

  • value

    the value to set the attribute version to.



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_stringObject



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