module XDG::BaseDir::Legacy

Legacy API can serve as a stop gap until a developer has time to update an program already using XDG.

Do NOT use this module for future development!!!

Public Instance Methods

cache() click to toggle source
# File lib/xdg/base_dir/legacy.rb, line 52
def cache
  obj = XDG['CACHE']
  class << obj
    def home
      XDG['CACHE_HOME'].to_a.first
    end
    def dirs
      XDG['CACHE_DIRS'].to_a
    end
    def work
      XDG['CACHE_WORK'].to_a
    end
  end
  return obj
end
config() click to toggle source
# File lib/xdg/base_dir/legacy.rb, line 35
def config
  obj = XDG['CONFIG']
  class << obj
    def home
      XDG['CONFIG_HOME'].to_a.first
    end
    def dirs
      XDG['CONFIG_DIRS'].to_a
    end
    def work
      XDG['CONFIG_WORK'].to_a
    end
  end
  return obj
end
data() click to toggle source
# File lib/xdg/base_dir/legacy.rb, line 21
def data
  obj = XDG['DATA']
  class << obj
    def home
      XDG['DATA_HOME'].to_a.first
    end
    def dirs
      XDG['DATA_DIRS'].to_a
    end
  end
  return obj
end
home() click to toggle source
# File lib/xdg/base_dir/legacy.rb, line 16
def home
  File.expand_path('~')
end