lib/qb/role/errors.rb in qb-0.3.12 vs lib/qb/role/errors.rb in qb-0.3.13

- old
+ new

@@ -1,5 +1,15 @@ +# Refinements +# ======================================================================= + +require 'nrser/refinements' +using NRSER + + +# Definitions +# ======================================================================= + module QB class Role # raised by `.require` when no roles match input class NoMatchesError < QB::UserInputError attr_accessor :input @@ -17,19 +27,17 @@ def initialize input, matches @input = input @matches = matches - super <<-END -multiple roles match input #{ @input.inspect }:\ - -#{ - @matches.map { |role| - "- #{ role.to_s } (#{ role.path.to_s })" - }.join("\n") -} - -END + super binding.erb <<-END + multiple roles match input <%= @input.inspect %>: + + <% @matches.map do |role| %> + - <%= role.to_s %> (<%= role.path.to_s %>) + <% end %> + + END end end # raised when there's bad metadata class MetadataError < QB::StateError \ No newline at end of file