lib/fiveruns/dash/instrument.rb in fiveruns-dash-ruby-0.7.6 vs lib/fiveruns/dash/instrument.rb in fiveruns-dash-ruby-0.8.0
- old
+ new
@@ -18,13 +18,13 @@
options = raw_targets.last.is_a?(Hash) ? raw_targets.pop : {}
raw_targets.each do |raw_target|
begin
obj, meth = case raw_target
when /^(.+)#(.+)$/
- [$1.constantize, $2]
+ [Fiveruns::Dash::Util.constantize($1), $2]
when /^(.+)(?:\.|::)(.+)$/
- [(class << $1.constantize; self; end), $2]
+ [(class << Fiveruns::Dash::Util.constantize($1); self; end), $2]
else
raise Error, "Bad target format: #{raw_target}"
end
instrument(obj, meth, options, &handler)
rescue Fiveruns::Dash::Instrument::Error => em
@@ -127,10 +127,10 @@
end
else
#{yield(format % :without)}
end
end
- alias_method_chain :#{meth}, :#{feature}
+ Fiveruns::Dash::Util.chain(self, :#{meth}, :#{feature})
DYNAMIC
end
end
\ No newline at end of file