Commit fb2478f7 authored by laiso's avatar laiso

Load the '*.podspec.json' file from a `:path` directive.

parent 579d37f7
...@@ -2,6 +2,14 @@ ...@@ -2,6 +2,14 @@
To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides/installing_cocoapods.html). To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides/installing_cocoapods.html).
## Master
##### Bug Fixes
* Fixes the detection of JSON podspecs included via `:path`.
[laiso](https://github.com/laiso)
[#2489](https://github.com/CocoaPods/CocoaPods/pull/2489)
## 0.34.0.rc2 ## 0.34.0.rc2
......
...@@ -16,7 +16,7 @@ module Pod ...@@ -16,7 +16,7 @@ module Pod
raise Informative, "No podspec found for `#{name}` in " \ raise Informative, "No podspec found for `#{name}` in " \
"`#{declared_path}`" "`#{declared_path}`"
end end
store_podspec(sandbox, podspec) store_podspec(sandbox, podspec, podspec.extname == '.json')
is_absolute = absolute?(declared_path) is_absolute = absolute?(declared_path)
sandbox.store_local_path(name, podspec.dirname, is_absolute) sandbox.store_local_path(name, podspec.dirname, is_absolute)
end end
...@@ -42,7 +42,8 @@ module Pod ...@@ -42,7 +42,8 @@ module Pod
# @return [Pathname] The absolute path of the podspec. # @return [Pathname] The absolute path of the podspec.
# #
def podspec_path def podspec_path
Pathname(normalized_podspec_path(declared_path)) path = Pathname(normalized_podspec_path(declared_path))
path.exist? ? path : Pathname("#{path}.json")
end end
# @return [Bool] # @return [Bool]
......
...@@ -87,6 +87,13 @@ module Pod ...@@ -87,6 +87,13 @@ module Pod
path = @subject.send(:podspec_path) path = @subject.send(:podspec_path)
path.should == Pathname(ENV['HOME']) + 'Reachability/Reachability.podspec' path.should == Pathname(ENV['HOME']) + 'Reachability/Reachability.podspec'
end end
it 'falls back to .podspec.json when .podspec doesnt exist' do
@subject.stubs(:params).returns(:path => 'Reachability')
Pathname.any_instance.stubs(:exist?).returns(false)
path = @subject.send(:podspec_path)
path.should == fixture('integration/Reachability/Reachability.podspec.json')
end
end end
describe '#absolute?' do describe '#absolute?' 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