Module Limelight::Gems
In: lib/limelight/gems.rb

Methods

Attributes

current_production  [RW] 

Public Class methods

[Source]

    # File lib/limelight/gems.rb, line 16
16:       def install(gem_name, paths)
17:         stack = paths.dup
18:         while !stack.empty?
19:           load_path.unshift File.join(current_production.gems_directory, gem_name, stack.pop)
20:         end
21:       end

TODO - MDM - This doesn‘t work when loading gems like: gem ‘gem_name’. Need make use of Gem::SourceIndex. See SourceIndex.load_gems_in

[Source]

    # File lib/limelight/gems.rb, line 24
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

[Source]

    # File lib/limelight/gems.rb, line 11
11:       def load_path
12:         @load_path = $: if @load_path.nil?
13:         return @load_path
14:       end

[Validate]