Skip to content

Commit

Permalink
[enhance] add 'lib/erubis/util.rb' which contains 'Kernel#not_impleme…
Browse files Browse the repository at this point in the history
…nted()'
  • Loading branch information
kwatch committed Mar 21, 2011
1 parent 5f4e4cd commit a0441cc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/erubis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module Erubis
#require 'erubis/evaluator'
#require 'erubis/error'
#require 'erubis/context'
#requier 'erubis/util'
require 'erubis/helper'
require 'erubis/enhancer'
#require 'erubis/tiny'
Expand Down
22 changes: 22 additions & 0 deletions lib/erubis/util.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
##
## $Release:$
## $Copyright$
##

module Kernel

##
## raise NotImplementedError
##
def not_implemented #:doc:
backtrace = caller()
method_name = (backtrace.shift =~ /`(\w+)'$/) && $1
mesg = "class #{self.class.name} must implement abstract method '#{method_name}()'."
#mesg = "#{self.class.name}##{method_name}() is not implemented."
err = NotImplementedError.new mesg
err.set_backtrace backtrace
raise err
end
private :not_implemented

end

0 comments on commit a0441cc

Please sign in to comment.