Sha256: 893c591c35c6050c26f7020d6c197c73cb111ae787a3df63d5161088726740bc

Contents?: true

Size: 975 Bytes

Versions: 6

Compression:

Stored size: 975 Bytes

Contents

# encoding: UTF-8

module Tetra
  # tetra get-pom
  class GetPomCommand < Tetra::BaseCommand
    parameter "NAME", "a jar file name or a `name-version` string (heuristic)"

    def execute
      checking_exceptions do
        project = Tetra::Project.new(".")
        pom_getter = Tetra::PomGetter.new

        path, status = pom_getter.get_pom(name)
        if path
          text_status = (
            if status == :found_in_jar
              "was inside the jar"
            elsif status == :found_via_sha1
              "found by sha1 search from search.maven.org"
            elsif status == :found_via_heuristic
              "found by heuristic search from search.maven.org"
            end
          )

          puts "#{format_path(path, project)} written, #{text_status}"
        else
          puts "#{name}'s pom not found. Try:"
          puts "http://google.com/#q=#{URI.encode(pom_getter.cleanup_name(name) + " pom")}"
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tetra-0.45.0 lib/tetra/commands/get_pom.rb
tetra-0.44.0 lib/tetra/commands/get_pom.rb
tetra-0.43.0 lib/tetra/commands/get_pom.rb
tetra-0.42.0 lib/tetra/commands/get_pom.rb
tetra-0.41.0 lib/tetra/commands/get_pom.rb
tetra-0.40.0 lib/tetra/commands/get_pom.rb