Sha256: da7523de2ecbcf89fca8cd82361e3f26ab0ca8c74a3db5ae0edf4b6b22065371

Contents?: true

Size: 1.06 KB

Versions: 17

Compression:

Stored size: 1.06 KB

Contents

# encoding: UTF-8

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

    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 = (
              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
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
tetra-2.0.6 lib/tetra/ui/get_pom_subcommand.rb
tetra-2.0.5 lib/tetra/ui/get_pom_subcommand.rb
tetra-2.0.4 lib/tetra/ui/get_pom_subcommand.rb
tetra-2.0.3 lib/tetra/ui/get_pom_subcommand.rb
tetra-2.0.2 lib/tetra/ui/get_pom_subcommand.rb
tetra-2.0.1 lib/tetra/ui/get_pom_subcommand.rb
tetra-2.0.0 lib/tetra/ui/get_pom_subcommand.rb
tetra-1.2.2 lib/tetra/ui/get_pom_subcommand.rb
tetra-1.2.1 lib/tetra/ui/get_pom_subcommand.rb
tetra-1.2.0 lib/tetra/ui/get_pom_subcommand.rb
tetra-1.1.0 lib/tetra/ui/get_pom_subcommand.rb
tetra-1.0.0 lib/tetra/ui/get_pom_subcommand.rb
tetra-0.54.0 lib/tetra/ui/get_pom_subcommand.rb
tetra-0.53.0 lib/tetra/ui/get_pom_subcommand.rb
tetra-0.52.0 lib/tetra/ui/get_pom_subcommand.rb
tetra-0.51.0 lib/tetra/ui/get_pom_subcommand.rb
tetra-0.50.0 lib/tetra/ui/get_pom_subcommand.rb