xdg 2.2.5 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/LICENSE.md +163 -0
- data/README.md +172 -89
- data/lib/xdg.rb +10 -44
- data/lib/xdg/cache.rb +22 -0
- data/lib/xdg/config.rb +23 -0
- data/lib/xdg/data.rb +23 -0
- data/lib/xdg/environment.rb +35 -0
- data/lib/xdg/identity.rb +22 -0
- data/lib/xdg/pair.rb +10 -0
- data/lib/xdg/paths/combined.rb +31 -0
- data/lib/xdg/paths/directory.rb +37 -0
- data/lib/xdg/paths/standard.rb +42 -0
- metadata +205 -39
- metadata.gz.sig +0 -0
- data/.index +0 -54
- data/.yardopts +0 -7
- data/DEMO.md +0 -144
- data/HISTORY.md +0 -148
- data/LICENSE.txt +0 -23
- data/demo/01_base_dir.md +0 -77
- data/demo/02_base_dir_extended.md +0 -47
- data/demo/03_base_dir_mixin.md +0 -17
- data/demo/applique/ae.rb +0 -2
- data/demo/applique/fakeroot.rb +0 -17
- data/demo/applique/xdg.rb +0 -1
- data/demo/fixtures/fakeroot/etc/xdg/bar.config +0 -1
- data/demo/fixtures/fakeroot/home/joe/foo.txt +0 -1
- data/demo/fixtures/fakeroot/usr/share/bar.dat +0 -1
- data/lib/xdg/base_dir.rb +0 -255
- data/lib/xdg/base_dir/extended.rb +0 -19
- data/lib/xdg/base_dir/global_variables.rb +0 -19
- data/lib/xdg/base_dir/legacy.rb +0 -74
- data/lib/xdg/base_dir/mixin.rb +0 -86
- data/lib/xdg/version.rb +0 -3
- data/test/fakeroot/etc/xdg/bar.config +0 -1
- data/test/fakeroot/usr/share/bar.dat +0 -1
- data/test/test_xdg_legacy.rb +0 -117
metadata.gz.sig
CHANGED
Binary file
|
data/.index
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
---
|
2
|
-
type: ruby
|
3
|
-
revision: 2019
|
4
|
-
sources:
|
5
|
-
- Index.yml
|
6
|
-
authors:
|
7
|
-
- name: Trans
|
8
|
-
email: transfire@gmail.com
|
9
|
-
organizations:
|
10
|
-
- name: Rubyworks
|
11
|
-
requirements:
|
12
|
-
- groups:
|
13
|
-
- build
|
14
|
-
development: true
|
15
|
-
name: detroit
|
16
|
-
- groups:
|
17
|
-
- test
|
18
|
-
development: true
|
19
|
-
name: qed
|
20
|
-
- groups:
|
21
|
-
- test
|
22
|
-
development: true
|
23
|
-
name: ae
|
24
|
-
conflicts: []
|
25
|
-
alternatives: []
|
26
|
-
resources:
|
27
|
-
- type: home
|
28
|
-
uri: http://rubyworks.github.com/xdg
|
29
|
-
label: Homepage
|
30
|
-
- type: code
|
31
|
-
uri: http://github.com/rubyworks/xdg
|
32
|
-
label: Source Code
|
33
|
-
- type: mail
|
34
|
-
uri: http://groups.goole.com/rubyworks-mailinglist
|
35
|
-
label: Mailing List
|
36
|
-
repositories:
|
37
|
-
- name: upstream
|
38
|
-
scm: git
|
39
|
-
uri: git://github.com/rubyworks/xdg.git
|
40
|
-
categories: []
|
41
|
-
load_path:
|
42
|
-
- lib
|
43
|
-
copyrights:
|
44
|
-
- holder: Rubyworks
|
45
|
-
year: '2008'
|
46
|
-
license: BSD-2-Clause
|
47
|
-
name: xdg
|
48
|
-
title: XDG
|
49
|
-
version: 2.2.5
|
50
|
-
summary: XDG provides an interface for using XDG directory standard.
|
51
|
-
description: XDG provides a module for supporting the XDG Base Directory Standard.
|
52
|
-
See http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
|
53
|
-
created: '2008-09-27'
|
54
|
-
date: '2019-05-21'
|
data/.yardopts
DELETED
data/DEMO.md
DELETED
@@ -1,144 +0,0 @@
|
|
1
|
-
# XDG Base Directory Standard
|
2
|
-
|
3
|
-
The 2.0 API is much a great deal more concise than the original
|
4
|
-
0.0+ and 1.0+ APIs. It consists primarily of a single
|
5
|
-
interface method `XDG[]`. Yet all the functionality of the older
|
6
|
-
API remain and then some.
|
7
|
-
|
8
|
-
First we need to require the library.
|
9
|
-
|
10
|
-
require 'xdg'
|
11
|
-
|
12
|
-
In the applique we have setup a fake root directory with
|
13
|
-
coorepsonding environment settings to use as test fixtures.
|
14
|
-
|
15
|
-
## Data Paths
|
16
|
-
|
17
|
-
### Home
|
18
|
-
|
19
|
-
XDG['DATA_HOME'].environment.assert == ENV['XDG_DATA_HOME'].to_s
|
20
|
-
XDG['DATA_HOME'].environment_variables.assert == ['XDG_DATA_HOME']
|
21
|
-
|
22
|
-
Looking at the data home location by default it should be point to
|
23
|
-
our joe user's home directory under `.local/share`.
|
24
|
-
|
25
|
-
XDG['DATA_HOME'].to_a.assert == [$froot + 'home/joe/.local/share']
|
26
|
-
|
27
|
-
### Dirs
|
28
|
-
|
29
|
-
XDG['DATA_DIRS'].environment.assert == ENV['XDG_DATA_DIRS'].to_s
|
30
|
-
XDG['DATA_DIRS'].environment_variables.assert == ['XDG_DATA_DIRS']
|
31
|
-
|
32
|
-
Looking at the system data locations
|
33
|
-
|
34
|
-
XDG['DATA_DIRS'].to_a.assert == [$froot + 'usr/share']
|
35
|
-
|
36
|
-
### Combined
|
37
|
-
|
38
|
-
XDG['DATA'].environment_variables.assert == ['XDG_DATA_HOME', 'XDG_DATA_DIRS']
|
39
|
-
|
40
|
-
Lookking at both data location combined
|
41
|
-
|
42
|
-
XDG['DATA'].to_a.assert == [$froot + 'home/joe/.local/share', $froot + 'usr/share']
|
43
|
-
|
44
|
-
|
45
|
-
## Config Paths
|
46
|
-
|
47
|
-
### Home
|
48
|
-
|
49
|
-
XDG['CONFIG_HOME'].environment.assert == ENV['XDG_CONFIG_HOME'].to_s
|
50
|
-
XDG['CONFIG_HOME'].to_a.assert == [$froot + 'home/joe/.config']
|
51
|
-
|
52
|
-
### Dirs
|
53
|
-
|
54
|
-
XDG['CONFIG_DIRS'].environment.assert == ENV['XDG_CONFIG_DIRS'].to_s
|
55
|
-
XDG['CONFIG_DIRS'].to_a.assert == [$froot + 'etc/xdg', $froot + 'etc']
|
56
|
-
|
57
|
-
### Combined
|
58
|
-
|
59
|
-
XDG['CONFIG'].to_a.assert == [$froot + 'home/joe/.config', $froot + 'etc/xdg', $froot + 'etc']
|
60
|
-
|
61
|
-
|
62
|
-
## Cache Paths
|
63
|
-
|
64
|
-
### Home
|
65
|
-
|
66
|
-
XDG['CACHE_HOME'].environment.assert == ENV['XDG_CACHE_HOME'].to_s
|
67
|
-
XDG['CACHE_HOME'].to_a.assert == [$froot + 'home/joe/.cache']
|
68
|
-
|
69
|
-
### Dirs
|
70
|
-
|
71
|
-
XDG['CACHE_DIRS'].environment.assert == ENV['XDG_CACHE_DIRS'].to_s
|
72
|
-
XDG['CACHE_DIRS'].to_a.assert == [$froot + 'tmp']
|
73
|
-
|
74
|
-
### Combined
|
75
|
-
|
76
|
-
XDG['CACHE'].to_a.assert == [$froot + 'home/joe/.cache', $froot + 'tmp']
|
77
|
-
|
78
|
-
|
79
|
-
# Extended Base Directory Standard
|
80
|
-
|
81
|
-
The extended base directory standard provides additional locations
|
82
|
-
not apart the offical standard. These are somewhat experimental.
|
83
|
-
|
84
|
-
## Resource
|
85
|
-
|
86
|
-
XDG['RESOURCE_HOME'].environment.assert == ENV['XDG_RESOURCE_HOME'].to_s
|
87
|
-
|
88
|
-
XDG['RESOURCE_HOME'].environment_variables.assert == ['XDG_RESOURCE_HOME']
|
89
|
-
|
90
|
-
Looking at the data home location by default it should be pointing to
|
91
|
-
our joe users home directory under `.local`.
|
92
|
-
|
93
|
-
XDG['RESOURCE_HOME'].list.assert == ['~/.local']
|
94
|
-
|
95
|
-
XDG['RESOURCE_HOME'].to_a.assert == [$froot + 'home/joe/.local']
|
96
|
-
|
97
|
-
|
98
|
-
## Work
|
99
|
-
|
100
|
-
The working configuration directory
|
101
|
-
|
102
|
-
XDG['CONFIG_WORK'].environment.assert == ENV['XDG_CONFIG_WORK'].to_s
|
103
|
-
|
104
|
-
XDG['CONFIG_WORK'].environment_variables.assert == ['XDG_CONFIG_WORK']
|
105
|
-
|
106
|
-
Looking at the config work location, by default it should be pointing to
|
107
|
-
the current working directorys `.config` or `config` directory.
|
108
|
-
|
109
|
-
XDG['CONFIG_WORK'].list.assert == ['.config', 'config']
|
110
|
-
|
111
|
-
XDG['CONFIG_WORK'].to_a.assert == [Dir.pwd + '/.config', Dir.pwd + '/config']
|
112
|
-
|
113
|
-
The working cache directory
|
114
|
-
|
115
|
-
XDG['CACHE_WORK'].environment.assert == ENV['XDG_CACHE_WORK'].to_s
|
116
|
-
|
117
|
-
XDG['CACHE_WORK'].environment_variables.assert == ['XDG_CACHE_WORK']
|
118
|
-
|
119
|
-
Looking at the cache work location, by default it should be pointing to
|
120
|
-
the current working directorys `.tmp` or `tmp` directory.
|
121
|
-
|
122
|
-
XDG['CACHE_WORK'].list.assert == ['.tmp', 'tmp']
|
123
|
-
|
124
|
-
XDG['CACHE_WORK'].to_a.assert == [Dir.pwd + '/.tmp', Dir.pwd + '/tmp']
|
125
|
-
|
126
|
-
|
127
|
-
# Base Directory Mixin
|
128
|
-
|
129
|
-
The base directory mixin is used to easy augment a class for
|
130
|
-
access to a named subdirectory of the XDG directories.
|
131
|
-
|
132
|
-
class MyAppConfig
|
133
|
-
include XDG::BaseDir::Mixin
|
134
|
-
|
135
|
-
def subdirectory
|
136
|
-
'myapp'
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
c = MyAppConfig.new
|
141
|
-
|
142
|
-
c.config.home.to_a #=> [$froot + 'home/joe/.config/myapp']
|
143
|
-
|
144
|
-
|
data/HISTORY.md
DELETED
@@ -1,148 +0,0 @@
|
|
1
|
-
# RELEASE HISTORY
|
2
|
-
|
3
|
-
## 2.2.3 / 2012-12-13
|
4
|
-
|
5
|
-
This release switches to RbConfig instead of Config, which Ruby
|
6
|
-
is deprecating.
|
7
|
-
|
8
|
-
Changes:
|
9
|
-
|
10
|
-
* Switch Config to RbConfig.
|
11
|
-
|
12
|
-
|
13
|
-
## 2.2.2 / 2011-10-30
|
14
|
-
|
15
|
-
Just a maintenance release to bring the build configuration
|
16
|
-
up to date. Also, change license to BSD-2-Clause.
|
17
|
-
|
18
|
-
Changes:
|
19
|
-
|
20
|
-
* Modernize build configuration
|
21
|
-
* Switch to BSD-2-Clause license.
|
22
|
-
|
23
|
-
|
24
|
-
## 2.2.1 / 2011-06-11
|
25
|
-
|
26
|
-
This release changes BaseDir#to_s to return the first directory
|
27
|
-
entry, and moves the old #to_s to #environment_with_defaults
|
28
|
-
with an alias of #env. The old #env now being called #environment.
|
29
|
-
|
30
|
-
Changes:
|
31
|
-
|
32
|
-
* Rename #env to #environment.
|
33
|
-
* Rename #to_s to #environment_with_defaults.
|
34
|
-
* Modify #to_s to return first directory.
|
35
|
-
|
36
|
-
|
37
|
-
## 2.1.0 / 2011-06-09
|
38
|
-
|
39
|
-
This release changes the BaseDir#list method, where as it used
|
40
|
-
to be an alias for #to_a, it now differs in that it does not
|
41
|
-
expand the paths. In addtion a few tests were fixed and version
|
42
|
-
number properly updated int hte version.rb file.
|
43
|
-
|
44
|
-
Changes:
|
45
|
-
|
46
|
-
* Change BaseDir#list to not expand paths.
|
47
|
-
* Properly assign VERSION constant.
|
48
|
-
* Fix broken qed tests.
|
49
|
-
|
50
|
-
|
51
|
-
## 2.0.0 / 2011-06-09
|
52
|
-
|
53
|
-
Major new release is full rewrite of the API, with an eye out for
|
54
|
-
support future XDG standards beyond the base directories. The
|
55
|
-
new API uses a single point of entry `XDG[]` (a shortcut for
|
56
|
-
`XDG::BaseDir[]`).
|
57
|
-
|
58
|
-
Changes:
|
59
|
-
|
60
|
-
* Complete rewrite of API.
|
61
|
-
* Utilize single point of entry interface.
|
62
|
-
* Structure project for future support of more of XDG.
|
63
|
-
|
64
|
-
|
65
|
-
## 1.0.0 / 2009-12-01
|
66
|
-
|
67
|
-
This is major reimplementation of the XDG API to be more flexiable
|
68
|
-
and object-oriented. Instead of a single module with every
|
69
|
-
needed method, the system is devided up into sub-modules, one for
|
70
|
-
each set of XDG locations. So, for example, instead of "XDG.data_dirs"
|
71
|
-
you use "XDG::Data.dirs" or "XDG.data.dirs".
|
72
|
-
|
73
|
-
Changes:
|
74
|
-
|
75
|
-
* Reworked API and underlying implementation to be more OOP-style.
|
76
|
-
* Began work on xdg/extended.rb, exploring future proposals.
|
77
|
-
* Provides xdg/compat.rb, for backward compatabilty (temporary).
|
78
|
-
|
79
|
-
|
80
|
-
## 0.5.2 / 2009-05-30
|
81
|
-
|
82
|
-
This release requires rbconfig.rb and uses system entries in place of
|
83
|
-
some hardcoded FHS locations.
|
84
|
-
|
85
|
-
Changes:
|
86
|
-
|
87
|
-
* Replaced hardcoded system directories with rbconfig entries.
|
88
|
-
|
89
|
-
|
90
|
-
## 0.5.1 / 2008-11-17
|
91
|
-
|
92
|
-
Changes:
|
93
|
-
|
94
|
-
* Fixed data work directory is '.local', not '.share'
|
95
|
-
* Deprecated #data_work
|
96
|
-
|
97
|
-
|
98
|
-
## 0.5.0 / 2008-10-28
|
99
|
-
|
100
|
-
Changes:
|
101
|
-
|
102
|
-
* Changed _glob to _select
|
103
|
-
|
104
|
-
|
105
|
-
## 0.4.0 / 2008-10-26
|
106
|
-
|
107
|
-
This release removes the xdg_ prefix from the instance-level
|
108
|
-
method names. Now module and instance levels are the same.
|
109
|
-
|
110
|
-
Also, data_file, config_file and cache_file have been replaced with
|
111
|
-
data_find, config_find, cache_find, data_glob, config_glob and
|
112
|
-
cache_glob.
|
113
|
-
|
114
|
-
What's next? Well, I can't say I'm fond of the term 'glob', so I
|
115
|
-
may rename that to 'map' or 'collect' (or 'select'?) and then
|
116
|
-
add the ability to use blocks for matching too.
|
117
|
-
|
118
|
-
Changes:
|
119
|
-
|
120
|
-
* Renamed instance level methods without 'xdg_' prefix.
|
121
|
-
* Replace _file methods with _find and _glob methods.
|
122
|
-
* Prepare for v0.4 release
|
123
|
-
* Remove some old commented-out code
|
124
|
-
* Fixed data_find and data_glob
|
125
|
-
* Update RELEASE file
|
126
|
-
* Updated documentation for 0.4 release
|
127
|
-
* Added MANIFEST to .gitignore
|
128
|
-
* Correction or RELEASE
|
129
|
-
* Fixed plural in RELEASE file
|
130
|
-
|
131
|
-
|
132
|
-
## 0.3.0 / 2008-10-11
|
133
|
-
|
134
|
-
Changes:
|
135
|
-
|
136
|
-
* Removed xdg_ prefix from module methods
|
137
|
-
* Moved web/index.html to doc directory
|
138
|
-
* Updated reap serives
|
139
|
-
* Prepare for next release
|
140
|
-
* Fixed issue of xdg_ prefix still being used internally
|
141
|
-
|
142
|
-
|
143
|
-
## 0.1.0 / 2008-09-27
|
144
|
-
|
145
|
-
Changes:
|
146
|
-
|
147
|
-
* Started project
|
148
|
-
|
data/LICENSE.txt
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
BSD-2-Clause License
|
2
|
-
|
3
|
-
Redistribution and use in source and binary forms, with or without
|
4
|
-
modification, are permitted provided that the following conditions are met:
|
5
|
-
|
6
|
-
1. Redistributions of source code must retain the above copyright notice,
|
7
|
-
this list of conditions and the following disclaimer.
|
8
|
-
|
9
|
-
2. Redistributions in binary form must reproduce the above copyright
|
10
|
-
notice, this list of conditions and the following disclaimer in the
|
11
|
-
documentation and/or other materials provided with the distribution.
|
12
|
-
|
13
|
-
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
14
|
-
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
15
|
-
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
16
|
-
COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
17
|
-
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
18
|
-
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
19
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
20
|
-
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
21
|
-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
22
|
-
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23
|
-
|
data/demo/01_base_dir.md
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
# XDG Base Directory Standard
|
2
|
-
|
3
|
-
The 2.0 API is much a great deal more concise than the original
|
4
|
-
0.0+ and 1.0+ APIs. It consists primarily of a single
|
5
|
-
interface method `XDG[]`. Yet all the functionality of the older
|
6
|
-
API remain and then some.
|
7
|
-
|
8
|
-
First we need to require the library.
|
9
|
-
|
10
|
-
require 'xdg'
|
11
|
-
|
12
|
-
In the applique we have setup a fake root directory with
|
13
|
-
coorepsonding environment settings to use as test fixtures.
|
14
|
-
|
15
|
-
## Data Paths
|
16
|
-
|
17
|
-
### Home
|
18
|
-
|
19
|
-
XDG['DATA_HOME'].environment.assert == ENV['XDG_DATA_HOME'].to_s
|
20
|
-
XDG['DATA_HOME'].environment_variables.assert == ['XDG_DATA_HOME']
|
21
|
-
|
22
|
-
Looking at the data home location by default it should be point to
|
23
|
-
our joe user's home directory under `.local/share`.
|
24
|
-
|
25
|
-
XDG['DATA_HOME'].to_a.assert == [$froot + 'home/joe/.local/share']
|
26
|
-
|
27
|
-
### Dirs
|
28
|
-
|
29
|
-
XDG['DATA_DIRS'].environment.assert == ENV['XDG_DATA_DIRS'].to_s
|
30
|
-
XDG['DATA_DIRS'].environment_variables.assert == ['XDG_DATA_DIRS']
|
31
|
-
|
32
|
-
Looking at the system data locations
|
33
|
-
|
34
|
-
XDG['DATA_DIRS'].to_a.assert == [$froot + 'usr/share']
|
35
|
-
|
36
|
-
### Combined
|
37
|
-
|
38
|
-
XDG['DATA'].environment_variables.assert == ['XDG_DATA_HOME', 'XDG_DATA_DIRS']
|
39
|
-
|
40
|
-
Lookking at both data location combined
|
41
|
-
|
42
|
-
XDG['DATA'].to_a.assert == [$froot + 'home/joe/.local/share', $froot + 'usr/share']
|
43
|
-
|
44
|
-
|
45
|
-
## Config Paths
|
46
|
-
|
47
|
-
### Home
|
48
|
-
|
49
|
-
XDG['CONFIG_HOME'].environment.assert == ENV['XDG_CONFIG_HOME'].to_s
|
50
|
-
XDG['CONFIG_HOME'].to_a.assert == [$froot + 'home/joe/.config']
|
51
|
-
|
52
|
-
### Dirs
|
53
|
-
|
54
|
-
XDG['CONFIG_DIRS'].environment.assert == ENV['XDG_CONFIG_DIRS'].to_s
|
55
|
-
XDG['CONFIG_DIRS'].to_a.assert == [$froot + 'etc/xdg', $froot + 'etc']
|
56
|
-
|
57
|
-
### Combined
|
58
|
-
|
59
|
-
XDG['CONFIG'].to_a.assert == [$froot + 'home/joe/.config', $froot + 'etc/xdg', $froot + 'etc']
|
60
|
-
|
61
|
-
|
62
|
-
## Cache Paths
|
63
|
-
|
64
|
-
### Home
|
65
|
-
|
66
|
-
XDG['CACHE_HOME'].environment.assert == ENV['XDG_CACHE_HOME'].to_s
|
67
|
-
XDG['CACHE_HOME'].to_a.assert == [$froot + 'home/joe/.cache']
|
68
|
-
|
69
|
-
### Dirs
|
70
|
-
|
71
|
-
XDG['CACHE_DIRS'].environment.assert == ENV['XDG_CACHE_DIRS'].to_s
|
72
|
-
XDG['CACHE_DIRS'].to_a.assert == [$froot + 'tmp']
|
73
|
-
|
74
|
-
### Combined
|
75
|
-
|
76
|
-
XDG['CACHE'].to_a.assert == [$froot + 'home/joe/.cache', $froot + 'tmp']
|
77
|
-
|