Class: Zypper::Onlinesearch::View::Search::Common

Inherits:
Object
  • Object
show all
Defined in:
lib/zypper/onlinesearch/view.rb

Overview

Common methods for the search operation.

Direct Known Subclasses

Report, Table

Class Method Summary collapse

Class Method Details

.no_compatible_packagesObject



32
33
34
35
# File 'lib/zypper/onlinesearch/view.rb', line 32

def self.no_compatible_packages
  puts "#{" " * 3} - | No compatible packages found!"
  separator
end

.no_packagesObject



27
28
29
30
# File 'lib/zypper/onlinesearch/view.rb', line 27

def self.no_packages
  puts "#{" " * 3} - | No packages found!"
  separator
end

.parameters(args) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/zypper/onlinesearch/view.rb', line 37

def self.parameters(args)
  engine = args[:engine].bold.red
  query = args[:query].bold
  cache = if args[:refresh]
            "Off".bold
          elsif args[:cache_time]
            "#{"On".bold.yellow} (#{args[:cache_time].strftime("%Y-%m-%d %H:%M")})"
          else
            "#{"On".bold.yellow} (Now)"
          end

  puts ""
  puts "=" * SEPARATOR_LENGTH
  puts "#{"Parameters:".bold} Engine: #{engine} | Query: #{query} | Cache: #{cache}"
  puts "=" * SEPARATOR_LENGTH
end

.separatorObject



23
24
25
# File 'lib/zypper/onlinesearch/view.rb', line 23

def self.separator
  puts "-" * SEPARATOR_LENGTH
end