TODO - MDM - This doesn‘t work when loading gems like: gem
‘gem_name’. Need make use of Gem::SourceIndex. See
SourceIndex.load_gems_in
24: def install_gems_in_production(production)
25: self.current_production = production
26:
27: gems_dir = current_production.gems_directory
28: if File.exists?(gems_dir) && File.directory?(gems_dir)
29: gems = Dir.entries(gems_dir).select { |dir| dir != "." && dir != ".." }
30: gems.sort!
31: gems.reverse!
32: gems.each do |gem_name|
33: init_file = File.join(gems_dir, gem_name, 'limelight_init.rb')
34: if File.exists?(init_file)
35: load init_file
36: else
37: puts "WARNING: Frozen gem (#{gem_name}) is missing limelight_init.rb file."
38: end
39: end
40: end
41:
42: Gem.use_paths(self.current_production.gems_root, Gem.default_path)
43:
44: self.current_production = nil
45: end