class Pact::Provider::Help::PromptText
Constants
- C
Attributes
options[R]
reports_dir[R]
Public Class Methods
call(reports_dir = Pact.configuration.reports_dir, options = {color: Pact.configuration.color_enabled})
click to toggle source
# File lib/pact/provider/help/prompt_text.rb, line 12 def self.call reports_dir = Pact.configuration.reports_dir, options = {color: Pact.configuration.color_enabled} new(reports_dir, options).call end
new(reports_dir, options)
click to toggle source
# File lib/pact/provider/help/prompt_text.rb, line 16 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/prompt_text.rb, line 21 def call options[:color] ? prompt_text_colored : prompt_text_plain end
Private Instance Methods
prompt_text_colored()
click to toggle source
# File lib/pact/provider/help/prompt_text.rb, line 33 def prompt_text_colored C.yellow(prompt_text_plain) end
prompt_text_plain()
click to toggle source
# File lib/pact/provider/help/prompt_text.rb, line 29 def prompt_text_plain "For assistance debugging failures, run `bundle exec rake pact:verify:help#{rake_args}`\n" end
rake_args()
click to toggle source
# File lib/pact/provider/help/prompt_text.rb, line 37 def rake_args if reports_dir == Pact.configuration.default_reports_dir '' else "[#{relative_reports_dir}]" end end
relative_reports_dir()
click to toggle source
# File lib/pact/provider/help/prompt_text.rb, line 45 def relative_reports_dir Pathname.new(reports_dir).relative_path_from(Pathname.new(Dir.pwd)) end