class BrewOutdatedFormatter::CLI
Command-line interface of {BrewOutdatedFormatter}
Constants
- FORMATTERS
Public Instance Methods
output()
click to toggle source
# File lib/brew_outdated_formatter/cli.rb, line 32 def output raise BrewOutdatedFormatter::UnknownFormatError, options[:format] unless allow_format? return if STDIN.tty? formatter = create_formatter formatter.read_stdin puts formatter.convert end
version()
click to toggle source
# File lib/brew_outdated_formatter/cli.rb, line 44 def version puts "brew_outdated_formatter #{BrewOutdatedFormatter::VERSION}" end
Private Instance Methods
allow_format?()
click to toggle source
# File lib/brew_outdated_formatter/cli.rb, line 50 def allow_format? FORMATTERS.keys.include?(options[:format]) end
create_formatter()
click to toggle source
# File lib/brew_outdated_formatter/cli.rb, line 54 def create_formatter FORMATTERS[options[:format]].new(options) end