Module: Ratch::XDGUtils

Defined in:
lib/ratch/utils/xdg.rb

Overview

The XDG utility module provides access ot the XDG library functions. This module requires the xdg gem.

This module simply maps the #xdg method to the XDG function module.

NOTE: This module is non-essential since one can just use the XDG module directly, however we want to encourage the use XDG, so it’s been provided to encourage that in the context of a Ratch script.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



24
25
26
# File 'lib/ratch/utils/xdg.rb', line 24

def self.extended(base)
  included(base)
end

.included(base) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/ratch/utils/xdg.rb', line 15

def self.included(base)
  begin
    require 'xdg'
  rescue
    $stderr << "The `xdg` gem is needed to use the XDGUtils module."
    exit -1
  end
end

Instance Method Details

#xdgObject

Simple access to XDG function module.

xdg.config.home  #=> "~/.config"


32
33
34
# File 'lib/ratch/utils/xdg.rb', line 32

def xdg
  XDG
end