engines/adva_cms/boot.rb
def plugin_gem(name, options = {})
    lib, version = options.values_at(:lib, :version)
    begin
      Kernel.send :gem, name, version
    rescue Gem::LoadError
      dir = File.dirname(caller.first.split(':').first)
      $: << File.expand_path("#{dir}/../vendor/gems/#{name}-#{version.gsub(/[^\d\.]*/, '')}/lib")
    end
    require(lib || name)
  end
# Rails' GemDependency makes it remarkably hard to extend and add any custom 
# behaviour. What we'd probably want is: check our plugin's vendor/gems directory
# and use shipped gem if the gem is not vendored in vendor/gems and not installed 
# on the system. The following implementation does that except that it does 
# not check for vendor/gems. Any takers?
Rails' GemDependency makes it remarkably hard to extend and add any custom
behaviour. What we'd probably want is: check our plugin's vendor/gems directory
and use shipped gem if the gem is not vendored in vendor/gems and not installed
on the system. The following implementation does that except that it does
not check for vendor/gems.
Rails ' GemDependency makes it remarkably hard to extend and add any custom behaviour . What we ' d probably want is : check our plugin ' s vendor / gems directory and use shipped gem if the gem is not vendored in vendor / gems and not installed on the system . The following implementation does that except that it does not check for vendor / gems .
def plugin_gem(name, options = {})
    lib, version = options.values_at(:lib, :version)
    begin
      Kernel.send :gem, name, version
    rescue Gem::LoadError
      dir = File.dirname(caller.first.split(':').first)
      $: << File.expand_path("#{dir}/../vendor/gems/#{name}-#{version.gsub(/[^\d\.]*/, '')}/lib")
    end
    require(lib || name)
  end
def plugin_gem ( name , options = { } ) lib , version = options . values_at ( :lib , :version ) begin Kernel . send :gem , name , version rescue Gem :: LoadError dir = File . dirname ( caller . first . split ( ':' ) . first ) $: << File . expand_path ( "#{dir}/../vendor/gems/#{name}-#{version.gsub(/[^\d\.]*/, '')}/lib" ) end require ( lib || name ) end
Rails' GemDependency makes it remarkably hard to extend and add any custom
behaviour.
Rails ' GemDependency makes it remarkably hard to extend and add any custom behaviour .
name
options