File tree 3 files changed +31
-2
lines changed
lib/cocoapods-core/specification
3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
##### Enhancements
6
6
7
+ * Better error messages, if unallowed version requirement is specified in Podspec.
8
+ [ Wolfgang Lutz] [ https://github.com/lutzifer ]
9
+ [ #466 ] ( https://github.com/CocoaPods/Core/pull/474 )
10
+
7
11
* DSL for ` scheme ` support.
8
12
[ Dimitris Koutsogiorgas] ( https://github.com/dnkoutso )
9
13
[ #7577 ] ( https://github.com/CocoaPods/CocoaPods/issues/7577 )
Original file line number Diff line number Diff line change @@ -677,8 +677,21 @@ def dependency(*args)
677
677
end
678
678
end
679
679
unless version_requirements . all? { |req | req . is_a? ( String ) }
680
- raise Informative , 'Unsupported version requirements'
680
+ version_requirements . each do |requirement |
681
+ if requirement . is_a? ( Hash )
682
+ if !requirement [ :path ] . nil?
683
+ raise Informative , 'Podspecs cannot specify the source of dependencies. The `:path` option is not supported.' \
684
+ ' `:path` can be used in the Podfile instead to override global dependencies.'
685
+ elsif !requirement [ :git ] . nil?
686
+ raise Informative , 'Podspecs cannot specify the source of dependencies. The `:git` option is not supported.' \
687
+ ' `:git` can be used in the Podfile instead to override global dependencies.'
688
+ end
689
+ end
690
+ end
691
+
692
+ raise Informative , "Unsupported version requirements. #{ version_requirements . inspect } is not valid."
681
693
end
694
+
682
695
attributes_hash [ 'dependencies' ] ||= { }
683
696
attributes_hash [ 'dependencies' ] [ name ] = version_requirements
684
697
end
Original file line number Diff line number Diff line change @@ -240,7 +240,19 @@ module Pod
240
240
it 'raises if the requirements are not supported' do
241
241
should . raise Informative do
242
242
@spec . dependency ( 'SVProgressHUD' , :head )
243
- end . message . should . match /Unsupported version requirements/
243
+ end . message . should . match /Unsupported version requirements. \[ \: head\] is not valid/
244
+ end
245
+
246
+ it 'raises if the requirements specify :git' do
247
+ should . raise Informative do
248
+ @spec . dependency ( 'SVProgressHUD' , :git => 'AnyPath' )
249
+ end . message . should . match /Podspecs cannot specify the source of dependencies. The `:git` option is not supported.\. */
250
+ end
251
+
252
+ it 'raises if the requirements specify :path' do
253
+ should . raise Informative do
254
+ @spec . dependency ( 'SVProgressHUD' , :path => 'AnyPath' )
255
+ end . message . should . match /Podspecs cannot specify the source of dependencies. The `:path` option is not supported.\. */
244
256
end
245
257
246
258
it 'raises when attempting to assign a value to dependency' do
You can’t perform that action at this time.
0 commit comments