Sha256: 9315d8b9d53d75c387ad9136f2d2f5c72de4858a0a8c5eb0f282f8375deb6338

Contents?: true

Size: 617 Bytes

Versions: 7

Compression:

Stored size: 617 Bytes

Contents

require 'rbconfig'

module Rabbit
  module Config
    IMAGE_PATH = [
      RbConfig::CONFIG["datadir"],
      File.join(".", "data"),
    ]
    append_path_from_gem = lambda do
      return unless Object.const_defined?(:Gem)
      rabbit_gem_spec = Gem.loaded_specs["rabbit"]
      return if rabbit_gem_spec.nil?
      unless rabbit_gem_spec.respond_to?(:activated?)
        def rabbit_gem_spec.activated?
          loaded?
        end
      end
      if rabbit_gem_spec.activated?
        IMAGE_PATH.unshift(File.join(rabbit_gem_spec.full_gem_path, "data"))
      end
    end
    append_path_from_gem.call
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rabbit-1.0.9 lib/rabbit/default-config.rb
rabbit-1.0.8 lib/rabbit/default-config.rb
rabbit-1.0.7 lib/rabbit/default-config.rb
rabbit-1.0.6 lib/rabbit/default-config.rb
rabbit-1.0.5 lib/rabbit/default-config.rb
rabbit-1.0.4 lib/rabbit/default-config.rb
rabbit-1.0.3 lib/rabbit/default-config.rb