Class: BundleOutdatedFormatter::Formatter
- Inherits:
-
Object
- Object
- BundleOutdatedFormatter::Formatter
- Defined in:
- lib/bundle_outdated_formatter/formatter.rb
Overview
Formatter for all formats
Direct Known Subclasses
CSVFormatter, HTMLFormatter, JSONFormatter, MarkdownFormatter, TSVFormatter, TerminalFormatter, XMLFormatter, YAMLFormatter
Constant Summary collapse
- GEM_REGEXP =
/\A\* (?<gem>.+) \(/
- NEWEST_REGEXP =
/newest (?<newest>[\d\.]+)/
- INSTALLED_REGEXP =
/installed (?<installed>[\d\.]+)/
- REQUESTED_REGEXP =
/requested (?<requested>.+)\)/
- GROUPS_REGEXP =
/in groups "(?<groups>.+)"/
- COLUMNS =
%w[gem newest installed requested groups].freeze
Instance Method Summary collapse
-
#initialize(options) ⇒ Formatter
constructor
A new instance of Formatter.
- #read_stdin ⇒ Object
Constructor Details
#initialize(options) ⇒ Formatter
Returns a new instance of Formatter.
14 15 16 17 18 |
# File 'lib/bundle_outdated_formatter/formatter.rb', line 14 def initialize() @pretty = [:pretty] @style = [:style] @outdated_gems = [] end |
Instance Method Details
#read_stdin ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/bundle_outdated_formatter/formatter.rb', line 20 def read_stdin @outdated_gems = STDIN.each.to_a.map(&:strip).reject(&:empty?) @outdated_gems.map! do |line| find_gem(line) end @outdated_gems.compact! end |