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
- COLUMNS =
%w[gem newest installed requested groups].freeze
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
28 29 30 |
# File 'lib/bundle_outdated_formatter/cli.rb', line 28 def self.exit_on_failure? false end |
Instance Method Details
#output ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/bundle_outdated_formatter/cli.rb', line 40 def output raise BundleOutdatedFormatter::UnknownFormatError, [:format] unless allow_format? raise BundleOutdatedFormatter::UnknownStyleError, [:style] unless allow_style? raise BundleOutdatedFormatter::UnknownColumnError, [:column] unless allow_column? return if STDIN.tty? formatter = create_formatter formatter.read_stdin puts formatter.convert end |
#version ⇒ Object
54 55 56 |
# File 'lib/bundle_outdated_formatter/cli.rb', line 54 def version puts "bundle_outdated_formatter #{BundleOutdatedFormatter::VERSION}" end |