Class: Pod::SpecBuilder
- Inherits:
-
Object
- Object
- Pod::SpecBuilder
- Defined in:
- lib/cocoapods-packager/spec_builder.rb
Instance Method Summary collapse
- #framework_path ⇒ Object
- #framework_path_by_platform(platform) ⇒ Object
-
#initialize(spec, source, embedded, dynamic, dependenciesPool) ⇒ SpecBuilder
constructor
A new instance of SpecBuilder.
- #spec_close ⇒ Object
- #spec_metadata ⇒ Object
- #spec_platform(platform) ⇒ Object
Constructor Details
#initialize(spec, source, embedded, dynamic, dependenciesPool) ⇒ SpecBuilder
Returns a new instance of SpecBuilder.
3 4 5 6 7 8 9 |
# File 'lib/cocoapods-packager/spec_builder.rb', line 3 def initialize(spec, source, , dynamic, dependenciesPool) @spec = spec @source = source.nil? ? '{ :path => \'.\' }' : source @embedded = @dynamic = dynamic @dependenciesPool = dependenciesPool end |
Instance Method Details
#framework_path ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/cocoapods-packager/spec_builder.rb', line 11 def framework_path if @embedded @spec.name + '.embeddedframework' + '/' + @spec.name + '.framework' else @spec.name + '.framework' end end |
#framework_path_by_platform(platform) ⇒ Object
19 20 21 |
# File 'lib/cocoapods-packager/spec_builder.rb', line 19 def framework_path_by_platform(platform) return platform.name.to_s + '/' + framework_path end |
#spec_close ⇒ Object
47 48 49 |
# File 'lib/cocoapods-packager/spec_builder.rb', line 47 def spec_close "end\n" end |
#spec_metadata ⇒ Object
42 43 44 45 |
# File 'lib/cocoapods-packager/spec_builder.rb', line 42 def spec = spec_header spec end |
#spec_platform(platform) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/cocoapods-packager/spec_builder.rb', line 23 def spec_platform(platform) fwk_base = platform.name.to_s + '/' + framework_path spec = <<RB s.#{platform.name}.deployment_target = '#{platform.deployment_target}' s.#{platform.name}.vendored_framework = '#{fwk_base}' RB %w(frameworks weak_frameworks libraries requires_arc xcconfig ).each do |attribute| attributes_hash = @spec.attributes_hash[platform.name.to_s] next if attributes_hash.nil? value = attributes_hash[attribute] next if value.nil? value = "'#{value}'" if value.class == String spec += " s.#{platform.name}.#{attribute} = #{value}\n" end spec end |