Exception: Suture::Error::InvalidPlan

Inherits:
StandardError
  • Object
show all
Defined in:
lib/suture/error/invalid_plan.rb

Constant Summary collapse

HEADER =
"Suture was unable to create your seam, because options passed to `Suture.create` were invalid."

Class Method Summary collapse

Class Method Details

.conflicting_options(conflicts) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/suture/error/invalid_plan.rb', line 29

def self.conflicting_options(conflicts)
  new "    \#{HEADER}\n\n    Suture isn't sure how to best handle the combination of options passed:\n\n      \#{conflicts.map {|message|\n          \"* \#{message}\"\n        }.join(\"\\n  \")}\n  MSG\nend\n".gsub(/^ {8}/,'')

.invalid_options(invalids) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/suture/error/invalid_plan.rb', line 17

def self.invalid_options(invalids)
  new "    \#{HEADER}\n\n    The following options were invalid:\n\n      \#{invalids.map {|(name,rule)|\n          \"* \#{name.inspect} - \#{rule[:message]}\"\n        }.join(\"\\n  \")}\n  MSG\nend\n".gsub(/^ {8}/,'')

.missing_requirements(requirements) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/suture/error/invalid_plan.rb', line 5

def self.missing_requirements(requirements)
  new "    \#{HEADER}\n\n    The following options are required:\n\n      \#{requirements.map {|(name,explanation)|\n          \"* \#{name.inspect} - \#{explanation}\"\n        }.join(\"\\n  \")}\n  MSG\nend\n".gsub(/^ {8}/,'')