Commit dd70ffdd authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #2489 from laiso/json_spec

[Installer] Load '*.podspec.json' file from `:path` directive.
parents f317cf7a fb2478f7
......@@ -2,6 +2,14 @@
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
......
......@@ -16,7 +16,7 @@ module Pod
raise Informative, "No podspec found for `#{name}` in " \
"`#{declared_path}`"
end
store_podspec(sandbox, podspec)
store_podspec(sandbox, podspec, podspec.extname == '.json')
is_absolute = absolute?(declared_path)
sandbox.store_local_path(name, podspec.dirname, is_absolute)
end
......@@ -42,7 +42,8 @@ module Pod
# @return [Pathname] The absolute path of the podspec.
#
def podspec_path
Pathname(normalized_podspec_path(declared_path))
path = Pathname(normalized_podspec_path(declared_path))
path.exist? ? path : Pathname("#{path}.json")
end
# @return [Bool]
......
......@@ -87,6 +87,13 @@ module Pod
path = @subject.send(:podspec_path)
path.should == Pathname(ENV['HOME']) + 'Reachability/Reachability.podspec'
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
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