Skip to content

Commit

Permalink
[Specification::DSL] Deprecate documentation attribute
Browse files Browse the repository at this point in the history
Closes #20
  • Loading branch information
fabiopelosin committed Aug 1, 2013
1 parent 8258ffd commit b102140
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 55 deletions.
22 changes: 0 additions & 22 deletions lib/cocoapods-core/specification/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -300,28 +300,6 @@ module DSL
:container => Array,
}

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

# @!method documentation=(documentation)
#
# This attribute is **not** currently used by CocoaPods as the
# documentation is now generated by [CocoaDocs](cocoadocs.org).
#
# Additional options to pass to the
# [appledoc](http://gentlebytes.com/appledoc/) tool.
#
# @example
#
# spec.documentation = { :appledoc => ['--no-repeat-first-par',
# '--no-warn-invalid-crossref'] }
#
# @param [Hash{Symbol=>Array<String>}] documentation
# Additional options to pass to the appledoc tool.
#
root_attribute :documentation, {
:container => Hash,
}

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

# @!group Platform
Expand Down
4 changes: 4 additions & 0 deletions lib/cocoapods-core/specification/dsl/deprecations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def singleton_method_added(method)
end
end

def documentation=(value)
CoreUI.warn "The `documentation` DSL directive of the podspec format has been deprecated."
end

def clean_paths=(value)
raise Informative, "[#{to_s}] Clean paths are deprecated. CocoaPods now " \
"cleans unused files by default. Use the `preserve_paths` attribute if needed."
Expand Down
7 changes: 0 additions & 7 deletions lib/cocoapods-core/specification/root_attribute_accessors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,6 @@ def screenshots
[*value]
end

# @return [Hash{Symbol=>Array<String>}] The options to pass to the
# appledoc tool.
#
def documentation
convert_keys_to_symbol(attributes_hash["documentation"])
end

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

private
Expand Down
7 changes: 0 additions & 7 deletions spec/fixtures/BananaLib.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ Pod::Spec.new do |s|
:file => 'LICENSE',
:text => 'Permission is hereby granted ...'
}
s.documentation = {
:html => 'http://banana-corp.local/banana-lib/docs.html',
:appledoc => [
'--project-company', 'Banana Corp',
'--company-id', 'com.banana',
]
}

# Platform
s.platform = :ios, '4.3'
Expand Down
7 changes: 0 additions & 7 deletions spec/fixtures/BananaLib.podspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ license:
type: MIT
file: LICENSE
text: Permission is hereby granted ...
documentation:
html: http://banana-corp.local/banana-lib/docs.html
appledoc:
- "--project-company"
- Banana Corp
- "--company-id"
- com.banana

# Root attributes
platforms:
Expand Down
5 changes: 5 additions & 0 deletions spec/specification/dsl/deprecations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ def @spec.copy_header_mapping
end.message.should.match /copy_header_mapping.*deprecated/
end

it "warns about the deprecated `documentation` attribute" do
@spec.documentation = {}
CoreUI.warnings.should.match /documentation.*deprecated/
end

it "raises for the deprecated `clean_paths` attribute" do
lambda { @spec.clean_paths = 'value' }.should.raise Informative
end
Expand Down
6 changes: 0 additions & 6 deletions spec/specification/dsl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ module Pod
@spec.attributes_hash["description"].should == 'text'
end

it "allows to specify the documentation settings" do
settings = { "appledoc" => ['--no-repeat-first-par', '--no-warn-invalid-crossref'] }
@spec.documentation = settings
@spec.attributes_hash["documentation"].should == settings
end

end

#-----------------------------------------------------------------------------#
Expand Down
5 changes: 0 additions & 5 deletions spec/specification/root_attribute_accessors_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,5 @@ module Pod
@spec.screenshots.should == ['www.example.com/img1.png']
end

it "returns any setting to pass to the appledoc tool" do
settings = { :appledoc => ['--no-repeat-first-par', '--no-warn-invalid-crossref'] }
@spec.documentation = settings
@spec.documentation.should == settings
end
end
end
2 changes: 1 addition & 1 deletion spec/specification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ module Pod
end

it "returns the checksum of the file in which it is defined" do
@spec.checksum.should == '8ff74d56f7a56f314d56f187cabfe342b8bfbc6b'
@spec.checksum.should == '1b6fff3413356e7975ad0852ab380d59e3929ffa'
end

it "returns a nil checksum if the specification is not defined in a file" do
Expand Down

0 comments on commit b102140

Please sign in to comment.