Method: Cog::Config#gem_dir

Defined in:
lib/cog/config.rb

#gem_dirString

Returns Location of the installed cog gem.

Returns:

  • (String)

    Location of the installed cog gem



24
25
26
27
28
29
30
31
32
33
# File 'lib/cog/config.rb', line 24

def gem_dir
  spec = Gem.loaded_specs['cog']
  if spec.nil?
    # The current __FILE__ is:
    #   ${COG_GEM_ROOT}/lib/cog/config.rb
    File.expand_path File.join(File.dirname(__FILE__), '..', '..')
  else
    spec.gem_dir
  end
end