class Pact::Provider::Help::ConsoleText
Attributes
Public Class Methods
Source
# 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
Source
# 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
Public Instance Methods
Source
# 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
Private Instance Methods
Source
# File lib/pact/provider/help/console_text.rb, line 46 def error_text_coloured Rainbow(error_text_plain).red end
Source
# File lib/pact/provider/help/console_text.rb, line 41 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
Source
# File lib/pact/provider/help/console_text.rb, line 37 def help_file_path File.join(reports_dir, Write::HELP_FILE_NAME) end
Source
# File lib/pact/provider/help/console_text.rb, line 33 def help_text File.read(help_file_path) end