Commit ba041adf authored by Mark Schall's avatar Mark Schall

cleaning up robocop warnings

parent 7b09cfc5
......@@ -39,10 +39,7 @@ module Pod
@allow_warnings = argv.flag?('allow-warnings')
@local_only = argv.flag?('local-only')
@repo = argv.shift_argument
begin
@source = config.sources_manager.source_with_name_or_url(@repo) unless @repo.nil?
rescue
end
@source = source_for_repo
@source_urls = argv.option('sources', config.sources_manager.all.map(&:url).join(',')).split(',')
@podspec = argv.shift_argument
@use_frameworks = !argv.flag?('use-libraries')
......@@ -246,6 +243,18 @@ module Pod
podspec_files.count
end
# Returns source for @repo
#
# @note If URL is invalid or repo doesn't exist, validate! will throw the error
#
# @return [Source]
#
def source_for_repo
config.sources_manager.source_with_name_or_url(@repo) unless @repo.nil?
rescue
nil
end
#---------------------------------------------------------------------#
end
end
......
......@@ -16,7 +16,7 @@ module Pod
e.message.should.match(/Unable to find the `missing_repo` repo/)
end
end
it "complains if it can't get repo url" do
Dir.chdir(fixture('banana-lib')) do
Command::Repo::Add.any_instance.stubs(:clone_repo)
......@@ -126,7 +126,7 @@ module Pod
Dir.chdir(@upstream) { `git checkout master -q` }
(@upstream + 'PushTest/1.4/PushTest.podspec').read.should.include('PushTest')
end
it 'successfully pushes a spec to URL' do
cmd = command('repo', 'push', @upstream)
Dir.chdir(@upstream) { `git checkout -b tmp_for_push -q` }
......
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