module Tapestry::Situation

Private Instance Methods

no_ready_check_possible() click to toggle source
# File lib/tapestry/situation.rb, line 61
def no_ready_check_possible
  puts "PROBLEM: A when ready call has no action.\n" \
  "You called a when_ready on a definition but did not provide " \
  "any action for it. Add a block with logic that should be " \
  "executed if the ready check passes.\n\n"
  raise Tapestry::Errors::NoBlockForWhenReady
end
no_title_is_provided() click to toggle source
# File lib/tapestry/situation.rb, line 45
def no_title_is_provided
  puts "PROBLEM: No title provided.\n" \
  "You called a '#{retrieve_method(caller)}' action but the " \
  "definition '#{self.class}' does not have a title_is attribute.\n\n"
  raise Tapestry::Errors::NoTitleForDefinition
end
no_url_match_is_possible() click to toggle source
# File lib/tapestry/situation.rb, line 30
def no_url_match_is_possible
  puts "PROBLEM: No url_is or url_matches attribute.\n" \
  "You called a '#{retrieve_method(caller)}' action but the " \
  "definition '#{self.class}' has no url_is attribute nor a " \
  "url_matches attribute.\n\n"
  raise Tapestry::Errors::NoUrlMatchPossible
end
no_url_provided() click to toggle source
# File lib/tapestry/situation.rb, line 14
def no_url_provided
  puts "PROBLEM: no url provided.\n" \
  "You called a '#{retrieve_method(caller)}' action but the " \
  "definition '#{self.class}' does not have a url_is attribute.\n" \
  "Either provide the url_is attribute or pass the url as an " \
  "argument to the visit call.\n\n"
  raise Tapestry::Errors::NoUrlForDefinition
end
not_ready_validation(message) click to toggle source
# File lib/tapestry/situation.rb, line 52
def not_ready_validation(message)
  puts "PROBLEM: A ready validation error was encountered.\n" \
  "A ready validation failed to validate. The ready check was " \
  "on the '#{self.class}' definition. " \
  "The reason provided was:\n" \
  "#{message}.\n\n"
  raise Tapestry::Errors::PageNotValidatedError, message
end
retrieve_class(caller) click to toggle source
# File lib/tapestry/situation.rb, line 69
def retrieve_class(caller)
  caller[1][/`.*'/][8..-3]
end
retrieve_method(caller) click to toggle source
# File lib/tapestry/situation.rb, line 73
def retrieve_method(caller)
  caller[0][/`.*'/][1..-2]
end
title_is_empty() click to toggle source
# File lib/tapestry/situation.rb, line 38
def title_is_empty
  puts "PROBLEM: title_is attribute empty.\n" \
  "The title_is attribute is empty on the definition " \
  "'#{retrieve_class(caller)}'.\n\n"
  raise Tapestry::Errors::NoTitleForDefinition
end
url_is_empty() click to toggle source
# File lib/tapestry/situation.rb, line 7
def url_is_empty
  puts "PROBLEM: url_is attribute empty.\n" \
  "The url_is attribute is empty on the definition " \
  "'#{retrieve_class(caller)}'.\n\n"
  raise Tapestry::Errors::NoUrlForDefinition
end
url_match_is_empty() click to toggle source
# File lib/tapestry/situation.rb, line 23
def url_match_is_empty
  puts "PROBLEM: url_matches attribute empty.\n" \
  "The url_matches attribute is empty on the definition " \
  "'#{retrieve_class(caller)}'.\n\n"
  raise Tapestry::Errors::NoUrlMatchForDefinition
end