Module: XDG::BaseDir::Legacy

Extended by:
Legacy
Included in:
XDG, Legacy
Defined in:
lib/xdg/base_dir/legacy.rb

Overview

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!!!

Instance Method Summary collapse

Instance Method Details

#cacheObject



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# 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

#configObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 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

#dataObject



21
22
23
24
25
26
27
28
29
30
31
32
# 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

#homeObject



16
17
18
# File 'lib/xdg/base_dir/legacy.rb', line 16

def home
  File.expand_path('~')
end