Class: Zypper::Onlinesearch::View::Search::Table
- Defined in:
- lib/zypper/onlinesearch/view.rb
Overview
Table view for search operation.
Direct Known Subclasses
Class Method Summary collapse
Methods inherited from Common
no_compatible_packages, no_packages, parameters, separator
Class Method Details
.header(args) ⇒ Object
85 86 87 88 89 90 91 |
# File 'lib/zypper/onlinesearch/view.rb', line 85 def self.header(args) @@first_col = args[:first_col] nl = (args[:first_col] - 4) / 2 puts "#{" " * 4}# | #{" " * nl} Page#{" " * nl} | Description" separator end |
.package(args) ⇒ Object
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/zypper/onlinesearch/view.rb', line 93 def self.package(args) name = args[:name] name = if name =~ / / name.split.map.with_index do |x, i| x = x.bold if i.zero? x end.join " " else name.bold end nl = 5 - args[:num].to_s.length fl = @@first_col - args[:name].length puts "#{" " * nl}#{args[:num]} | #{name}#{" " * fl} | #{args[:description]}" separator end |