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>.+) \(/.freeze
- NEWEST_REGEXP =
/newest (?<newest>[\d.]+)/.freeze
- INSTALLED_REGEXP =
/installed (?<installed>[\d.]+)/.freeze
- REQUESTED_REGEXP =
/requested (?<requested>.+)\)/.freeze
- GROUPS_REGEXP =
/in groups? "(?<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.
12 13 14 15 16 17 |
# File 'lib/bundle_outdated_formatter/formatter.rb', line 12 def initialize() @pretty = [:pretty] @style = [:style] @columns = [:column] @outdated_gems = [] end |
Instance Method Details
#read_stdin ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/bundle_outdated_formatter/formatter.rb', line 19 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 |