Class: Dependencies::Gem

Inherits:
Dependency show all
Defined in:
lib/dependencies/gem.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, #should_meet?, #success?, #type

Constructor Details

This class inherits a constructor from Dependency

Instance Method Details

#meetObject



12
13
14
15
16
17
18
19
20
# File 'lib/dependencies/gem.rb', line 12

def meet
	if Options.get("gem.use_sudo")
		execute("sudo gem install #{name}")
	elsif Options.get("gem.user_install")
		execute("gem install --user-install #{name}")
	else
		execute("gem install #{name}")
	end
end

#met?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/dependencies/gem.rb', line 8

def met?
	execute("gem list -i '^#{name}$'")
end

#unmeetObject



22
23
24
25
# File 'lib/dependencies/gem.rb', line 22

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