Skip to content

Commit

Permalink
Merge pull request wpscanteam#950 from anthraxx/master
Browse files Browse the repository at this point in the history
bump terminal-table to 1.6.0 and drop workaround
  • Loading branch information
ethicalhack3r committed Jun 7, 2016
2 parents 8e9d29e + 5435df4 commit b1a8f44
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 45 deletions.
5 changes: 1 addition & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ gem 'typhoeus', '>=0.8.0'
gem 'nokogiri', '>=1.6.7.2'
gem 'addressable'
gem 'yajl-ruby' # Better JSON parser regarding memory usage
# TODO: update the below when terminal-table 1.5.3+ is released.
# See issue #841 for details
# (and delete the Terminal module in lib/common/hacks.rb)
gem 'terminal-table', '~>1.4.5'
gem 'terminal-table', '>=1.6.0'
gem 'ruby-progressbar', '>=1.6.0'

group :test do
Expand Down
41 changes: 0 additions & 41 deletions lib/common/hacks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,47 +27,6 @@ def puts(o = '')
super(o)
end

module Terminal
class Table
def render
separator = Separator.new(self)
buffer = [separator]
unless @title.nil?
buffer << Row.new(self, [title_cell_options])
buffer << separator
end
unless @headings.cells.empty?
buffer << @headings
buffer << separator
end
buffer += @rows
buffer << separator
buffer.map { |r| style.margin_left + r.render }.join("\n")
end
alias :to_s :render

class Style
@@defaults = {
:border_x => '-', :border_y => '|', :border_i => '+',
:padding_left => 1, :padding_right => 1,
:margin_left => '',
:width => nil, :alignment => nil
}

attr_accessor :margin_left
attr_accessor :border_x
attr_accessor :border_y
attr_accessor :border_i

attr_accessor :padding_left
attr_accessor :padding_right

attr_accessor :width
attr_accessor :alignment
end
end
end

class Numeric
def bytes_to_human
units = %w{B KB MB GB TB}
Expand Down

0 comments on commit b1a8f44

Please sign in to comment.