Class: Dependencies::Apt

Inherits:
Dependency show all
Defined in:
lib/dependencies/apt.rb

Constant Summary

Constants inherited from Dependency

Dependency::DESCRIPTION_TYPE_WIDTH

Instance Attribute Summary

Attributes inherited from Dependency

#exit_code, #name, #output

Instance Method Summary collapse

Methods inherited from Dependency

#always_act?, #initialize, #success?, #type

Constructor Details

This class inherits a constructor from Dependency

Instance Method Details

#meetObject



11
12
13
# File 'lib/dependencies/apt.rb', line 11

def meet
	execute("#{sudo_string}apt-get install -y #{name}")
end

#met?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/dependencies/apt.rb', line 7

def met?
	execute("dpkg-query --show --showformat '${db:Status-Status}\n' #{name} | grep -q ^installed")
end

#should_meet?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/dependencies/apt.rb', line 20

def should_meet?
	`uname`.chomp == "Linux"
end

#unmeetObject



15
16
17
18
# File 'lib/dependencies/apt.rb', line 15

def unmeet
	# do nothing; we don't want to uninstall packages and reinstall them every time
	true
end