lib/berkshelf/formatters/null.rb in berkshelf-3.0.0.beta7 vs lib/berkshelf/formatters/null.rb in berkshelf-3.0.0.beta8
- old
+ new
@@ -1,22 +1,12 @@
module Berkshelf
- module Formatters
- class Null
- include AbstractFormatter
-
- register_formatter :null
-
- # The abstract formatter dynamically defines methods that raise an
- # AbstractFunction error. We need to define all of those on our class,
- # otherwise they will be inherited by the Ruby object model.
- AbstractFormatter.instance_methods.each do |meth|
- define_method(meth) do |*args|
- # intentionally do nothing
- end
- end
-
- def method_missing(meth, *args, &block)
- # intentionally do nothing
- end
+ class NullFormatter < BaseFormatter
+ # The base formatter dynamically defines methods that raise an
+ # AbstractFunction error. We need to define all of those on our class,
+ # otherwise they will be inherited by the Ruby object model.
+ BaseFormatter.instance_methods(false).each do |name|
+ class_eval <<-EOH, __FILE__, __LINE__ + 1
+ def #{name}(*args); end
+ EOH
end
end
end