lib/r10k/keyed_factory.rb in r10k-2.3.1 vs lib/r10k/keyed_factory.rb in r10k-2.4.0
- old
+ new
@@ -13,11 +13,11 @@
@implementations = {}
end
def register(key, klass)
if @implementations.has_key?(key)
- raise DuplicateImplementationError, "Class already registered for #{key}"
+ raise DuplicateImplementationError, _("Class already registered for %{key}") % {key: key}
else
@implementations[key] = klass
end
end
@@ -27,10 +27,10 @@
def generate(key, *args)
if (impl = @implementations[key])
impl.new(*args)
else
- raise UnknownImplementationError, "No class registered for #{key}"
+ raise UnknownImplementationError, _("No class registered for %{key}") % {key: key}
end
end
class DuplicateImplementationError < StandardError; end
class UnknownImplementationError < StandardError; end