Sha256: f65d3768b8823fae979b368be7221b991a50bf258850b4005fbbe09ff2bde22c

Contents?: true

Size: 613 Bytes

Versions: 3

Compression:

Stored size: 613 Bytes

Contents

require 'httpclient'
require 'nokogiri'
require 'yaml'

module NexusCli
  class RemoteFactory 
    class << self
      attr_reader :configuration
      attr_reader :connection

      def create(overrides, ssl_verify=true)
        @configuration = Configuration::parse(overrides)
        @connection = Connection.new(configuration, ssl_verify)
        running_nexus_pro? ? ProRemote.new(overrides, ssl_verify) : OSSRemote.new(overrides, ssl_verify)
      end

      private

      def running_nexus_pro?
        return connection.status['edition_long'] == "Professional" ? true : false
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nexus_cli-2.0.2 lib/nexus_cli/remote_factory.rb
nexus_cli-2.0.1 lib/nexus_cli/remote_factory.rb
nexus_cli-2.0.0 lib/nexus_cli/remote_factory.rb