class Pact::Provider::Help::PromptText
Attributes
Public Class Methods
Source
# File lib/pact/provider/help/prompt_text.rb, line 10 def self.call reports_dir = Pact.configuration.reports_dir, options = {color: Pact.configuration.color_enabled} new(reports_dir, options).call end
Source
# File lib/pact/provider/help/prompt_text.rb, line 14 def initialize reports_dir, options @reports_dir = File.expand_path(reports_dir) @options = options end
Public Instance Methods
Source
# File lib/pact/provider/help/prompt_text.rb, line 19 def call options[:color] ? prompt_text_colored : prompt_text_plain end
Private Instance Methods
Source
# File lib/pact/provider/help/prompt_text.rb, line 31 def prompt_text_colored Rainbow(prompt_text_plain).yellow end
Source
# File lib/pact/provider/help/prompt_text.rb, line 27 def prompt_text_plain "For assistance debugging failures, run `bundle exec rake pact:verify:help#{rake_args}`\n" end
Source
# File lib/pact/provider/help/prompt_text.rb, line 35 def rake_args if reports_dir == Pact.configuration.default_reports_dir '' else "[#{relative_reports_dir}]" end end
Source
# File lib/pact/provider/help/prompt_text.rb, line 43 def relative_reports_dir Pathname.new(reports_dir).relative_path_from(Pathname.new(Dir.pwd)) end