lib/jah/act_pkg/pacman.rb
def search(filter = nil)
      pkgs = []
      installed = all(filter) # until figure out a memoize for all this
      run("pacman -Ss #{filter}").to_a.each_slice(2) do |info, desc|
        name, version, size = info.split("/")[1].split(" ")
        state = installed.find { |i| i.name == name }
        pkgs << Pkg.new(state ? :installed : :new, name, version, desc.strip)
      end
      pkgs
    end
# -Ss /regex/ search all pkgs
Ss /regex/ search all pkgs
Ss / regex / search all pkgs
def search(filter = nil)
      pkgs = []
      installed = all(filter) 
      run("pacman -Ss #{filter}").to_a.each_slice(2) do |info, desc|
        name, version, size = info.split("/")[1].split(" ")
        state = installed.find { |i| i.name == name }
        pkgs << Pkg.new(state ? :installed : :new, name, version, desc.strip)
      end
      pkgs
    end
def search ( filter = nil ) pkgs = [ ] installed = all ( filter ) run ( "pacman -Ss #{filter}" ) . to_a . each_slice ( 2 ) do | info , desc | name , version , size = info . split ( "/" ) [ 1 ] . split ( " " ) state = installed . find { | i | i . name == name } pkgs << Pkg . new ( state ? :installed : :new , name , version , desc . strip ) end pkgs end
Ss /regex/ search all pkgs
Ss / regex / search all pkgs
# until figure out a memoize for all this
filter