Class: Pact::Provider::Help::ConsoleText
- Inherits:
-
Object
- Object
- Pact::Provider::Help::ConsoleText
- Defined in:
- lib/pact/provider/help/console_text.rb
Defined Under Namespace
Classes: ColorizeMarkdown
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(reports_dir, options) ⇒ ConsoleText
constructor
A new instance of ConsoleText.
Constructor Details
#initialize(reports_dir, options) ⇒ ConsoleText
Returns a new instance of ConsoleText.
16 17 18 19 |
# File 'lib/pact/provider/help/console_text.rb', line 16 def initialize reports_dir, @reports_dir = File.(reports_dir) = end |
Class Method Details
.call(reports_dir = Pact.configuration.reports_dir, options = {color: true}) ⇒ Object
12 13 14 |
# File 'lib/pact/provider/help/console_text.rb', line 12 def self.call reports_dir = Pact.configuration.reports_dir, = {color: true} new(reports_dir || Pact.configuration.reports_dir, ).call end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/pact/provider/help/console_text.rb', line 21 def call begin [:color] ? ColorizeMarkdown.(help_text) : help_text rescue Errno::ENOENT [:color] ? error_text_coloured : error_text_plain end end |