Skip to content

Commit

Permalink
[Specification::DSL] name isn't a root attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
mrackwitz committed Apr 4, 2015
1 parent 6d93f49 commit a6d508f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions lib/cocoapods-core/specification/consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def self.spec_attr_accessor(name)

# @!group Regular attributes

# @return [String] The name of the specification.
#
spec_attr_accessor :name

# @return [Bool] Whether the source files of the specification require to
# be compiled with ARC.
#
Expand Down
6 changes: 4 additions & 2 deletions lib/cocoapods-core/specification/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ module DSL
# @param [String] name
# the name of the pod.
#
root_attribute :name,
:required => true
attribute :name,
:required => true,
:inherited => false,
:multi_platform => false

#------------------#

Expand Down
7 changes: 4 additions & 3 deletions lib/cocoapods-core/specification/linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def lint
@results = Results.new
if spec
check_required_root_attributes
validate_name
run_root_validation_hooks
perform_all_specs_analysis
else
Expand Down Expand Up @@ -164,11 +165,9 @@ def run_validation_hooks(attributes, target)

private

# @!group Root spec validation helpers

# Performs validations related to the `name` attribute.
#
def _validate_name(_n)
def validate_name
if spec.name && file
acceptable_names = [
spec.root.name + '.podspec',
Expand All @@ -192,6 +191,8 @@ def _validate_name(_n)
end
end

# @!group Root spec validation helpers

def _validate_authors(a)
if a.is_a? Hash
if a == { 'YOUR NAME HERE' => 'YOUR EMAIL HERE' }
Expand Down

0 comments on commit a6d508f

Please sign in to comment.