lib/gjp/commands/get_source.rb in gjp-0.38.0 vs lib/gjp/commands/get_source.rb in gjp-0.39.0

- old
+ new

@@ -1,8 +1,9 @@ # encoding: UTF-8 module Gjp + # gjp get-source class GetSourceCommand < Gjp::BaseCommand parameter "POM", "a pom file path or URI" def execute checking_exceptions do @@ -14,20 +15,15 @@ puts "Source jar found and added to Maven repository." else effective_pom_path = Gjp::MavenRunner.new(project).get_effective_pom(pom) puts "Source jar not found in Maven. Try looking here:" pom = Gjp::Pom.new(effective_pom_path) - unless pom.url.empty? - puts "Website: #{pom.url}" - end - unless pom.scm_connection.empty? - puts "SCM connection: #{pom.scm_connection}" - end - unless pom.scm_url.empty? - puts "SCM connection: #{pom.scm_url}" - end + puts "Website: #{pom.url}" unless pom.url.empty? + puts "SCM connection: #{pom.scm_connection}" unless pom.scm_connection.empty? + puts "SCM connection: #{pom.scm_url}" unless pom.scm_url.empty? puts "The effective POM: #{effective_pom_path}" - puts "Google: http://google.com/#q=#{URI.encode(pom.name + " sources")}" + name = !pom.name.empty? ? pom.name : pom.artifact_id + puts "Google: http://google.com/#q=#{URI.encode("#{name} sources")}" end end end end end