Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 60a3dfbadbbc42367d11b7b994e0d4c3060adc16 1 parent efde62c
@arches authored
Showing with 7 additions and 11 deletions.
  1. +7 −1 lib/table_print.rb
  2. +0 −10 lib/table_print/kernel_extensions.rb
View
8 lib/table_print.rb
@@ -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
View
10 lib/table_print/kernel_extensions.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.