Sha256: 177c0f8ee6b1b96d83a3c91c13ec91126a017304b5b82673142ac7c2eb0afb54

Contents?: true

Size: 723 Bytes

Versions: 47

Compression:

Stored size: 723 Bytes

Contents

module Decko
  DECKO_GEM_ROOT = File.expand_path("../..", __FILE__)

  class << self
    def root
      Rails.root
    end

    def application
      Rails.application
    end

    def config
      application.config
    end

    def paths
      application.paths
    end

    def gem_root
      DECKO_GEM_ROOT
    end

    def card_gem_root
      @card_gem_root ||= locate_gem "card"
    end

    private

    def locate_gem name
      spec = Bundler.load.specs.find { |s| s.name == name }
      unless spec
        raise GemNotFound, "Could not find gem '#{name}' in the current bundle."
      end
      return File.expand_path("../../../", __FILE__) if spec.name == "bundler"
      spec.full_gem_path
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
decko-0.10.0 lib/decko.rb
decko-0.9.6 lib/decko.rb
decko-0.9.5 lib/decko.rb
decko-0.9.4 lib/decko.rb
decko-0.9.3 lib/decko.rb
decko-0.9.2 lib/decko.rb
decko-0.9.1 lib/decko.rb
decko-0.9.0 lib/decko.rb
decko-0.8.3 lib/decko.rb
decko-0.8.2 lib/decko.rb
decko-0.8.1 lib/decko.rb
decko-0.8.0 lib/decko.rb
decko-0.7.0 lib/decko.rb
decko-0.7.0.pre lib/decko.rb
decko-0.6.8 lib/decko.rb
decko-0.6.7 lib/decko.rb
decko-0.6.6 lib/decko.rb
decko-0.6.5 lib/decko.rb
decko-0.6.4 lib/decko.rb
decko-0.6.3 lib/decko.rb