Class: Tetra::GetPomSubcommand
- Inherits:
-
Subcommand
- Object
- Subcommand
- Tetra::GetPomSubcommand
- Defined in:
- lib/tetra/ui/get_pom_subcommand.rb
Overview
tetra get-pom
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/tetra/ui/get_pom_subcommand.rb', line 10 def execute checking_exceptions do project = Tetra::Project.new(".") ensure_dry_running(:is_not_in_progress, project) do pom_getter = Tetra::PomGetter.new path, status = pom_getter.get_pom(name) if path text_status = { found_in_jar: "was inside the jar", found_via_sha1: "found by sha1 search from search.maven.org", found_via_heuristic: "found by heuristic search from search.maven.org" }[status] puts "#{format_path(path, project)} written, #{text_status}" else puts "#{name}'s pom not found. Try:" # URI.encode_www_form_component correctly escapes spaces to '+' for query params. clean_name = pom_getter.cleanup_name(name) query = "#{clean_name} pom" puts "http://google.com/#q=#{URI.encode_www_form_component(query)}" end end end end |