class Pact::Provider::Help::ConsoleText
Constants
- C
Attributes
options[R]
reports_dir[R]
Public Class Methods
call(reports_dir = Pact.configuration.reports_dir, options = {color: true})
click to toggle source
# File lib/pact/provider/help/console_text.rb, line 14 def self.call reports_dir = Pact.configuration.reports_dir, options = {color: true} new(reports_dir || Pact.configuration.reports_dir, options).call end
new(reports_dir, options)
click to toggle source
# File lib/pact/provider/help/console_text.rb, line 18 def initialize reports_dir, options @reports_dir = File.expand_path(reports_dir) @options = options end
Public Instance Methods
call()
click to toggle source
# File lib/pact/provider/help/console_text.rb, line 23 def call begin options[:color] ? ColorizeMarkdown.(help_text) : help_text rescue Errno::ENOENT options[:color] ? error_text_coloured : error_text_plain end end
Private Instance Methods
error_text_coloured()
click to toggle source
# File lib/pact/provider/help/console_text.rb, line 48 def error_text_coloured C.red(error_text_plain) end
error_text_plain()
click to toggle source
# File lib/pact/provider/help/console_text.rb, line 43 def error_text_plain "Sorry, could not find help file at #{help_file_path}. Please ensure you have run `rake pact:verify`.\n" + "If this does not fix the problem, please raise a github issues for this bug." end
help_file_path()
click to toggle source
# File lib/pact/provider/help/console_text.rb, line 39 def help_file_path File.join(reports_dir, Write::HELP_FILE_NAME) end
help_text()
click to toggle source
# File lib/pact/provider/help/console_text.rb, line 35 def help_text File.read(help_file_path) end