Commit a4108542 authored by Eloy Duran's avatar Eloy Duran

Delegate a few more Subspec attributes to the top level spec.

parent fc91353f
......@@ -53,10 +53,13 @@ module Pod
def summary=(summary)
@summary = summary
@description ||= summary
end
attr_reader :summary
def description
@description || summary
end
def part_of=(*name_and_version_requirements)
self.part_of_dependency = *name_and_version_requirements
@part_of.only_part_of_other_pod = true
......@@ -111,7 +114,7 @@ module Pod
attr_writer :compiler_flags
def compiler_flags
flags = "#{@compiler_flags} "
flags << '-fobjc-arc' if @requires_arc
flags << '-fobjc-arc' if requires_arc
flags
end
......@@ -127,8 +130,6 @@ module Pod
end
attr_reader :dependencies
# Subspec related
def subspec(name, &block)
subspec = Subspec.new(self, name, &block)
@subspecs << subspec
......@@ -136,6 +137,13 @@ module Pod
end
attr_reader :subspecs
# Not attributes
# TODO when we move to use a 'ResolveContext' this should happen there.
attr_accessor :defined_in_set
include Config::Mixin
def subspec_by_name(name)
# Remove this spec's name from the beginning of the name we’re looking for
# and take the first component from the remainder, which is the spec we need
......@@ -149,19 +157,6 @@ module Pod
remainder.empty? ? subspec : subspec.subspec_by_name(name)
end
# These are attributes which are also on a Podfile
# TODO remove this, we no longer allow to install specs as Podfile
attr_accessor :generate_bridge_support
alias_method :generate_bridge_support?, :generate_bridge_support
# Not attributes
# TODO when we move to use a 'ResolveContext' this should happen there.
attr_accessor :defined_in_set
include Config::Mixin
def ==(other)
object_id == other.object_id ||
(self.class === other &&
......@@ -428,6 +423,10 @@ module Pod
def defined_in_set
top_level_parent.defined_in_set
end
def requires_arc
top_level_parent.requires_arc
end
end
end
......
......@@ -288,6 +288,7 @@ describe "A Pod::Specification subspec" do
s.version = '1.2.3'
s.summary = 'A spec with subspecs'
s.source = { :git => '/some/url' }
s.requires_arc = true
s.subspec 'FirstSubSpec' do |fss|
fss.subspec 'SecondSubSpec' do |sss|
......@@ -315,8 +316,12 @@ describe "A Pod::Specification subspec" do
it "automatically forwards undefined attributes to the top level parent" do
@spec.subspecs.first.summary.should == @spec.summary
@spec.subspecs.first.source.should == @spec.source
@spec.subspecs.first.requires_arc.should == true
@spec.subspecs.first.compiler_flags.should == ' -fobjc-arc'
@spec.subspecs.first.subspecs.first.summary.should == @spec.summary
@spec.subspecs.first.subspecs.first.source.should == @spec.source
@spec.subspecs.first.subspecs.first.requires_arc.should == true
@spec.subspecs.first.subspecs.first.compiler_flags.should == ' -fobjc-arc'
end
it "returns subspecs by name" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment