Commit 1564c00f authored by Samuel Giddins's avatar Samuel Giddins

[Repo::Push] Update for new public source methods

parent dc37e1b0
...@@ -7,7 +7,7 @@ GIT ...@@ -7,7 +7,7 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Core.git remote: https://github.com/CocoaPods/Core.git
revision: ec49c1259eabe6cdf6a9f416fc5c0ca905c4ced2 revision: bb1c7033bb34016da92364222fd20517c4e25d2a
branch: seg-source-metadata branch: seg-source-metadata
specs: specs:
cocoapods-core (1.0.0.beta.6) cocoapods-core (1.0.0.beta.6)
......
...@@ -38,7 +38,7 @@ module Pod ...@@ -38,7 +38,7 @@ module Pod
@allow_warnings = argv.flag?('allow-warnings') @allow_warnings = argv.flag?('allow-warnings')
@local_only = argv.flag?('local-only') @local_only = argv.flag?('local-only')
@repo = argv.shift_argument @repo = argv.shift_argument
@source = config.sources_manager.source_with_name_or_url(@repo) @source = config.sources_manager.sources([@repo]).first
@source_urls = argv.option('sources', config.sources_manager.all.map(&:url).join(',')).split(',') @source_urls = argv.option('sources', config.sources_manager.all.map(&:url).join(',')).split(',')
@podspec = argv.shift_argument @podspec = argv.shift_argument
@use_frameworks = !argv.flag?('use-libraries') @use_frameworks = !argv.flag?('use-libraries')
...@@ -49,8 +49,14 @@ module Pod ...@@ -49,8 +49,14 @@ module Pod
end end
def validate! def validate!
super
help! 'A spec-repo name is required.' unless @repo help! 'A spec-repo name is required.' unless @repo
unless @source.repo.directory?
raise Informative,
"Unable to find the `#{@repo}` repo. " \
'If it has not yet been cloned, add it via `pod repo add`.'
end
super
end end
def run def run
...@@ -162,7 +168,7 @@ module Pod ...@@ -162,7 +168,7 @@ module Pod
UI.puts "\nAdding the #{'spec'.pluralize(count)} to the `#{@repo}' repo\n".yellow UI.puts "\nAdding the #{'spec'.pluralize(count)} to the `#{@repo}' repo\n".yellow
podspec_files.each do |spec_file| podspec_files.each do |spec_file|
spec = Pod::Specification.from_file(spec_file) spec = Pod::Specification.from_file(spec_file)
output_path = @source.specs_dir + @source.send(:pod_path, name) + version.to_s output_path = @source.pod_path(spec.name) + spec.version.to_s
if @message && !@message.empty? if @message && !@message.empty?
message = @message message = @message
elsif output_path.exist? elsif output_path.exist?
......
...@@ -12,10 +12,8 @@ module Pod ...@@ -12,10 +12,8 @@ module Pod
it "complains if it can't find the repo" do it "complains if it can't find the repo" do
Dir.chdir(fixture('banana-lib')) do Dir.chdir(fixture('banana-lib')) do
cmd = command('repo', 'push', 'missing_repo') cmd = command('repo', 'push', 'missing_repo')
cmd.expects(:check_if_master_repo) e = lambda { cmd.validate! }.should.raise Informative
cmd.expects(:validate_podspec_files).returns(true) e.message.should.match(/Unable to find the `missing_repo` repo/)
e = lambda { cmd.run }.should.raise Informative
e.message.should.match(/repo not found/)
end end
end end
......
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