Class: BundleOutdatedFormatter::CLI
- Inherits:
-
Thor
- Object
- Thor
- BundleOutdatedFormatter::CLI
- Defined in:
- lib/bundle_outdated_formatter/cli.rb
Overview
Command-line interface of BundleOutdatedFormatter
Constant Summary collapse
- FORMATTERS =
{ 'terminal' => TerminalFormatter, 'markdown' => MarkdownFormatter, 'json' => JSONFormatter, 'yaml' => YAMLFormatter, 'csv' => CSVFormatter, 'tsv' => TSVFormatter, 'xml' => XMLFormatter, 'html' => HTMLFormatter }.freeze
- STYLES =
%w[unicode ascii].freeze
Instance Method Summary collapse
Instance Method Details
#output ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/bundle_outdated_formatter/cli.rb', line 34 def output raise BundleOutdatedFormatter::UnknownFormatError, [:format] unless allow_format? raise BundleOutdatedFormatter::UnknownStyleError, [:style] unless allow_style? return if STDIN.tty? formatter = create_formatter formatter.read_stdin puts formatter.convert end |
#version ⇒ Object
47 48 49 |
# File 'lib/bundle_outdated_formatter/cli.rb', line 47 def version puts "bundle_outdated_formatter #{BundleOutdatedFormatter::VERSION}" end |