# This file is part of shellfire core. It is subject to the licence terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/shellfire-dev/core/master/COPYRIGHT. No part of shellfire core, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
# Copyright © 2014-2015 The developers of shellfire core. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/shellfire-dev/core/master/COPYRIGHT.


core_dependency_requires '*' ruby
core_dependency_languagePackageManagers_Ruby_packageManager()
{
	if core_variable_isSet core_dependency_check_forcePackageManagerUpgradeDuringInstall; then
		if [ $core_dependency_check_forcePackageManagerUpgradeDuringInstall -eq 1 ]; then
			core_message NOTICE "Updating gem manager"
			gem update
		fi
	fi
	
	local gem
	for gem in "$@"
	do
		# gem help list documentation (2.1.2_3) refers to 'STRING' when it means 'regex'!
		if ! gem list "^${gem}$" --installed --local 1>/dev/null; then
			gem install "$gem"
		fi
	done
}
