Class: Pod::SpecBuilder
- Inherits:
-
Object
- Object
- Pod::SpecBuilder
- Defined in:
- lib/cocoapods-packager/spec_builder.rb
Instance Method Summary collapse
- #framework_path ⇒ Object
-
#initialize(spec, source, embedded, dynamic) ⇒ SpecBuilder
constructor
A new instance of SpecBuilder.
- #spec_close ⇒ Object
- #spec_metadata ⇒ Object
- #spec_platform(platform) ⇒ Object
Constructor Details
#initialize(spec, source, embedded, dynamic) ⇒ SpecBuilder
Returns a new instance of SpecBuilder.
3 4 5 6 7 8 |
# File 'lib/cocoapods-packager/spec_builder.rb', line 3 def initialize(spec, source, , dynamic) @spec = spec @source = source.nil? ? '{ :path => \'.\' }' : source @embedded = @dynamic = dynamic end |
Instance Method Details
#framework_path ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/cocoapods-packager/spec_builder.rb', line 10 def framework_path if @embedded @spec.name + '.embeddedframework' + '/' + @spec.name + '.framework' else @spec.name + '.framework' end end |
#spec_close ⇒ Object
42 43 44 |
# File 'lib/cocoapods-packager/spec_builder.rb', line 42 def spec_close "end\n" end |
#spec_metadata ⇒ Object
37 38 39 40 |
# File 'lib/cocoapods-packager/spec_builder.rb', line 37 def spec = spec_header spec end |
#spec_platform(platform) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/cocoapods-packager/spec_builder.rb', line 18 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 |