Sha256: 89b0da674533bf33583cb0c8770ed756d3ab8c64bebcf8f74bc328f408c8dcf2

Contents?: true

Size: 900 Bytes

Versions: 7

Compression:

Stored size: 900 Bytes

Contents

# frozen_string_literal: true

module Pennyworth
  module CLI
    module Parsers
      # Handles parsing of Command Line Interface (CLI) RubyGems options.
      class RubyGems
        def self.call(...) = new(...).call

        def initialize configuration = Configuration::Loader.call, client: Parser::CLIENT
          @configuration = configuration
          @client = client
        end

        def call arguments = []
          client.separator "\nRUBYGEMS OPTIONS:\n"
          add_owner
          client.parse arguments
          configuration
        end

        private

        attr_reader :configuration, :client

        def add_owner
          client.on "--owner [HANDLE]", %(Set owner. Default: "#{owner}".) do |handle|
            configuration.ruby_gems_owner = handle || owner
          end
        end

        def owner = configuration.ruby_gems_owner
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pennyworth-12.3.1 lib/pennyworth/cli/parsers/ruby_gems.rb
pennyworth-12.3.0 lib/pennyworth/cli/parsers/ruby_gems.rb
pennyworth-12.2.0 lib/pennyworth/cli/parsers/ruby_gems.rb
pennyworth-12.1.0 lib/pennyworth/cli/parsers/ruby_gems.rb
pennyworth-12.0.2 lib/pennyworth/cli/parsers/ruby_gems.rb
pennyworth-12.0.1 lib/pennyworth/cli/parsers/ruby_gems.rb
pennyworth-12.0.0 lib/pennyworth/cli/parsers/ruby_gems.rb