/usr/lib/ruby/vendor_ruby/sequel/extensions/pretty_table.rb is in ruby-sequel 4.1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # The pretty_table extension adds Sequel::Dataset#print and the
# Sequel::PrettyTable class for creating nice-looking plain-text
# tables. Example:
#
# +--+-------+
# |id|name |
# |--+-------|
# |1 |fasdfas|
# |2 |test |
# +--+-------+
#
# You can load this extension into specific datasets:
#
# ds = DB[:table]
# ds.extension(:pretty_table)
#
# Or you can load it into all of a database's datasets, which
# is probably the desired behavior if you are using this extension:
#
# DB.extension(:pretty_table)
module Sequel
extension :_pretty_table
module DatasetPrinter
# Pretty prints the records in the dataset as plain-text table.
def print(*cols)
ds = naked
rows = ds.all
Sequel::PrettyTable.print(rows, cols.empty? ? ds.columns : cols)
end
end
Dataset.register_extension(:pretty_table, DatasetPrinter)
end
|