Class: Avm::EacRubyBase1::Rubygems::Providers::Nexus

Inherits:
Base
  • Object
show all
Defined in:
lib/avm/eac_ruby_base1/rubygems/providers/nexus.rb

Instance Method Summary collapse

Methods inherited from Base

#push_gem, #to_s

Instance Method Details

#gem_versions(gem_name) ⇒ Enumerable<String>

Returns:

  • (Enumerable<String>)


12
13
14
15
16
17
18
19
20
21
# File 'lib/avm/eac_ruby_base1/rubygems/providers/nexus.rb', line 12

def gem_versions(gem_name)
  search_result = ::Avm::EacRubyBase1::Rubygems::GemSearchParser.from_string(
    EacRubyUtils::Envs.local.command(
      'gem', 'search', '--quiet', '--exact', '--all',
      '--remote', '--clear-sources', '--source', root_http_url, gem_name
    ).execute!
  ).data
  (search_result.key?(gem_name) ? search_result.fetch(gem_name) : [])
    .map { |e| { 'number' => e } }
end

#push_gem_command_args(gem_package_path) ⇒ Enumerable<String>

Parameters:

  • gem_package_path (Pathname)

Returns:

  • (Enumerable<String>)


25
26
27
# File 'lib/avm/eac_ruby_base1/rubygems/providers/nexus.rb', line 25

def push_gem_command_args(gem_package_path)
  ['gem', 'nexus', '--clear-repo', '--url', root_http_url, gem_package_path]
end