Class: Pact::Provider::Help::ConsoleText
- Inherits:
-
Object
- Object
- Pact::Provider::Help::ConsoleText
show all
- Defined in:
- lib/pact/provider/help/console_text.rb
Defined Under Namespace
Classes: ColorizeMarkdown
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(reports_dir, options) ⇒ ConsoleText
16
17
18
19
|
# File 'lib/pact/provider/help/console_text.rb', line 16
def initialize reports_dir, options
@reports_dir = File.expand_path(reports_dir)
@options = options
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, options = {color: true}
new(reports_dir || Pact.configuration.reports_dir, options).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
options[:color] ? ColorizeMarkdown.(help_text) : help_text
rescue Errno::ENOENT
options[:color] ? error_text_coloured : error_text_plain
end
end
|