Commit 69aba4c1 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #3533 from CocoaPods/kylef/pod-push-json

[pod repo push] Discover and push JSON specs while pushing from a directory
parents 9d23b199 142570b5
...@@ -13,6 +13,12 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -13,6 +13,12 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
[cocoapods-try#31](https://github.com/CocoaPods/cocoapods-try/issues/31) [cocoapods-try#31](https://github.com/CocoaPods/cocoapods-try/issues/31)
##### Bug Fixes
* `pod repo push` will now find and push JSON podspecs.
[#3494](https://github.com/CocoaPods/CocoaPods/issues/3494)
[Kyle Fuller](https://github.com/kylef)
## 0.37.1 ## 0.37.1
......
...@@ -190,9 +190,15 @@ module Pod ...@@ -190,9 +190,15 @@ module Pod
# @return [Array<Pathname>] The path of the specifications to push. # @return [Array<Pathname>] The path of the specifications to push.
# #
def podspec_files def podspec_files
files = Pathname.glob(@podspec || '*.podspec') if @podspec
raise Informative, "Couldn't find any .podspec file in current directory" if files.empty? path = Pathname(@podspec)
files raise Informative, "Couldn't find #{@podspec}" unless path.exist?
[path]
else
files = Pathname.glob('*.podspec{,.json}')
raise Informative, "Couldn't find any podspec files in current directory" if files.empty?
files
end
end end
# @return [Integer] The number of the podspec files to push. # @return [Integer] The number of the podspec files to push.
......
...@@ -22,7 +22,13 @@ module Pod ...@@ -22,7 +22,13 @@ module Pod
it "complains if it can't find a spec" do it "complains if it can't find a spec" do
repo_make('test_repo') repo_make('test_repo')
e = lambda { run_command('repo', 'push', 'test_repo') }.should.raise Pod::Informative e = lambda { run_command('repo', 'push', 'test_repo') }.should.raise Pod::Informative
e.message.should.match(/Couldn't find any .podspec/) e.message.should.match(/Couldn't find any podspec/)
end
it "complains if it can't find the given podspec" do
repo_make('test_repo')
e = lambda { run_command('repo', 'push', 'test_repo', 'testspec.podspec') }.should.raise Pod::Informative
e.message.should.match(/Couldn't find testspec\.podspec/)
end end
it "it raises if the specification doesn't validate" do it "it raises if the specification doesn't validate" do
...@@ -38,6 +44,16 @@ module Pod ...@@ -38,6 +44,16 @@ module Pod
end end
end end
it 'finds JSON podspecs' do
repo_make('test_repo')
Dir.chdir(temporary_directory) do
File.open('JSON.podspec.json', 'w') { |f| f.write('{}') }
cmd = command('repo', 'push', 'test_repo')
cmd.send(:podspec_files).should == [Pathname('JSON.podspec.json')]
end
end
#--------------------------------------# #--------------------------------------#
before do before 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