Skip to content

Commit

Permalink
Merge pull request #95 from CocoaPods/resource_bundle_not_empty
Browse files Browse the repository at this point in the history
A spec is not longer empty if it contains a resource_bundle
  • Loading branch information
kapin committed Apr 3, 2014
2 parents 5591d7e + 907b87d commit 802552d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
[Fabio Pelosin][irrationalfab]
[CocoaPods#2005](https://github.com/CocoaPods/CocoaPods/issues/2005)

* A spec is no longer considered empty if it only contains a resource_bundle
[Joshua Kalpin][Kapin]
[#63](https://github.com/CocoaPods/Core/issues/63)
[#95](https://github.com/CocoaPods/Core/pull/95)


## 0.31.1

Expand Down
5 changes: 3 additions & 2 deletions lib/cocoapods-core/specification/linter/analyzer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ def check_tmp_arc_not_nil
# Check empty subspec attributes
#
def check_if_spec_is_empty
methods = %w( source_files resources preserve_paths dependencies vendored_libraries vendored_frameworks )
methods = %w( source_files resources resource_bundles preserve_paths dependencies
vendored_libraries vendored_frameworks )
empty_patterns = methods.all? { |m| consumer.send(m).empty? }
empty = empty_patterns && consumer.spec.subspecs.empty?
if empty
error "The #{consumer.spec} spec is empty (no source files, " \
"resources, preserve paths, vendored_libraries, " \
"resources, resource_bundles, preserve paths, vendored_libraries, " \
"vendored_frameworks dependencies or subspecs)."
end
end
Expand Down
1 change: 1 addition & 0 deletions spec/specification/linter/analyzer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module Pod
consumer = Specification::Consumer
consumer.any_instance.stubs(:source_files).returns([])
consumer.any_instance.stubs(:resources).returns({})
consumer.any_instance.stubs(:resource_bundles).returns([])
consumer.any_instance.stubs(:preserve_paths).returns([])
consumer.any_instance.stubs(:subspecs).returns([])
consumer.any_instance.stubs(:dependencies).returns([])
Expand Down

0 comments on commit 802552d

Please sign in to comment.