Module: Qwandry

Defined in:
lib/qwandry.rb,
lib/qwandry/package.rb,
lib/qwandry/launcher.rb,
lib/qwandry/repository.rb,
lib/qwandry/configuration.rb,
lib/qwandry/flat_repository.rb,
lib/qwandry/library_repository.rb

Overview

Launcher is the core Qwandry class, it coordinates finding and launching a package. It is driven externaly by a UI, for instance the ‘bin/qw`.

Defined Under Namespace

Classes: Configuration, FlatRepository, Launcher, LibraryRepository, Package, Repository

Class Method Summary collapse

Class Method Details

.config_dirObject

If defined, Qwandry will use XDG_CONFIG_HOME as the xdg spec. If not it will check for an existing ‘~/.qwandry`. Finally it will fall back to `~/.config/qwandry`.

Returns either the path the config_dir or nil if HOME is not defined.

XDG Spec:

http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html


36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/qwandry.rb', line 36

def Qwandry.config_dir
  subdir = '/.qwandry/'
  if ENV['XDG_CONFIG_HOME']
    File.join(ENV['XDG_CONFIG_HOME'], subdir)
  elsif File.exist? File.join(ENV['HOME'], subdir)
    File.join(ENV['HOME'], subdir)
  elsif ENV['HOME']
    File.join(ENV['HOME'],'.config', subdir)
  else
    nil
  end
end