/usr/share/modules/init/ruby.rb is in environment-modules 3.2.10-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | if !ENV.has_key?('MODULE_VERSION') then
ENV['MODULE_VERSION_STACK'] = "3.2.10"
ENV['MODULE_VERSION'] = "3.2.10"
else
ENV['MODULE_VERSION_STACK'] = ENV['MODULE_VERSION']
end
ENV['MODULESHOME'] = "/usr/share/modules"
if !ENV.has_key?('MODULEPATH') then
ENV['MODULEPATH'] = File.open("#{ENV['MODULESHOME']}/init/.modulespath","r").readlines.reject {|e| e =~ /^(\s*#|$)/}.join(":")
end
if !ENV.has_key?('LOADEDMODULES') then
ENV['LOADEDMODULES'] = ''
end
class ENVModule
def ENVModule.module(*args)
if args[0].kind_of?(Array) then
args = args[0].join(" ")
else
args = args.join(" ")
end
exec_prefix = "/usr/share/modules/#{ENV['MODULE_VERSION']}"
eval `/usr/bin/modulecmd ruby #{args}`
end
def ENVModule.load(args)
ENVModule.module "load #{self.get_args(args)}"
end
def ENVModule.unload(args)
ENVModule.module "unload #{self.get_args(args)}"
end
def ENVModule.list
ENVModule.module 'list'
end
private
def ENVModule.get_args(args)
if args.kind_of?(Array) then
arg = args.join(" ")
else
arg = args
end
return arg
end
end
|