class Gemstory::Cli

Handles the CLI commands

Attributes

history[R]
printer[R]

Public Class Methods

new(argv) click to toggle source
# File lib/gemstory/cli.rb, line 10
def initialize(argv)
  @history = Reader.new(argv)

  @printer = if argv.empty?
               Printer::Horizontal
             elsif argv.length == 1
               Printer::Vertical
             else
               Printer::Horizontal
             end
end

Public Instance Methods

execute() click to toggle source
# File lib/gemstory/cli.rb, line 23
def execute
  @history.call

  @printer.new(@history).call
end