Class: Pennyworth::CLI::Parsers::RubyGems

Inherits:
Object
  • Object
show all
Defined in:
lib/pennyworth/cli/parsers/ruby_gems.rb

Overview

Handles parsing of Command Line Interface (CLI) RubyGems options.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration = Configuration::Loader.call, client: CLIENT) ⇒ RubyGems

Returns a new instance of RubyGems.



10
11
12
13
# File 'lib/pennyworth/cli/parsers/ruby_gems.rb', line 10

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

Class Method Details

.callObject



8
# File 'lib/pennyworth/cli/parsers/ruby_gems.rb', line 8

def self.call(...) = new(...).call

Instance Method Details

#call(arguments = []) ⇒ Object



15
16
17
18
19
# File 'lib/pennyworth/cli/parsers/ruby_gems.rb', line 15

def call arguments = []
  client.separator "\nRUBYGEMS OPTIONS:\n"
  add_owner
  arguments.empty? ? arguments : client.parse!(arguments)
end