Permalink
Browse files

don't extend kernal, just define a method in the global namespace

  • Loading branch information...
arches committed Jul 27, 2012
1 parent efde62c commit 60a3dfbadbbc42367d11b7b994e0d4c3060adc16
Showing with 7 additions and 11 deletions.
  1. +7 −1 lib/table_print.rb
  2. +0 −10 lib/table_print/kernel_extensions.rb
View
@@ -5,7 +5,6 @@
require 'table_print/fingerprinter'
require 'table_print/formatter'
require 'table_print/hash_extensions'
-require 'table_print/kernel_extensions'
require 'table_print/printable'
require 'table_print/row_group'
require 'table_print/returnable'
@@ -49,3 +48,10 @@ def columns
end
end
end
+
+def tp(data=[], *options)
+ start = Time.now
+ printer = TablePrint::Printer.new(data, options)
+ puts printer.table_print unless data.is_a? Class
+ TablePrint::Returnable.new(Time.now - start) # we have to return *something*, might as well be execution time.
+end
@@ -1,10 +0,0 @@
-module Kernel
- def tp(data=[], *options)
- start = Time.now
- printer = TablePrint::Printer.new(data, options)
- puts printer.table_print unless data.is_a? Class
- TablePrint::Returnable.new(Time.now - start) # we have to return *something*, might as well be execution time.
- end
-
- module_function :tp
-end

0 comments on commit 60a3dfb

Please sign in to comment.