xdg 4.5.0 → 5.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - checksums.yaml.gz.sig +1 -1
 - data.tar.gz.sig +1 -1
 - data/lib/xdg/environment.rb +6 -18
 - data/lib/xdg/identity.rb +1 -1
 - data/lib/xdg/pair.rb +4 -12
 - data/lib/xdg/paths/combined.rb +4 -12
 - data/lib/xdg/paths/directory.rb +5 -15
 - data/lib/xdg/paths/home.rb +5 -15
 - metadata +14 -14
 - metadata.gz.sig +0 -0
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: '059e1f4e12570ab83b80fa00f5e146d4216a71aecc895fcfd654d9cdd4f248e9'
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5a62a333572c24b29f83d6a45306ed64fccf0287ea6f1953c4dcf6fc763f161d
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f322b56e826c51f44e52384aeee93981ba78ace188fd6c0b7f2f02e71b5be4b8be8ed0c52d4d6121642f5438503ed3abe7ff0458f1ea8c8af6e2dde9f4efb77d
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 4d48e03643ecd5aea2cf0bbe7f813a9cd3ed6eb19dd79aa792b7940d590713d86a70ac5b4f00cf35461181f8c9c3e65a7cc75c6e5bb704f5612741aaafe544b5
         
     | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            -K�,��*=	BkFo|�I�iCǓy�P-���#j�Q�)�=���cCŵ�����L)�}E�^N~P�!���<��@d��ㅶ�\����*8���Q2L�À��f[u��f�l�T*sJ3�}��$�v��X��O#��a�-P�^���|+��	E��ar�7���*x><��W$ةtm_c�Sz��w�ѧ݈f�jd�հ��-�t_t:ʊ~T ��Y-������ɔ�9�����1ьtV��m���
         
     | 
    
        data.tar.gz.sig
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            :Ǡ�G�1#}��a[m�E�j;r��g3����v�ú4+��H�i�#q)��%]�G%/_��Ն1�H#R͘Qäv���k���i�����;\a�o���w���|�D��Jh�!�������>�e͡re�Tv�{��/=�p�A���{����R}5ؓȘ��K��U�)o!6kL����#�&�`�V�+���xAS(�#c��>�ж���j��!��Y^Tc�`������ɤ�r<�>J�L=��c<{|
         
     | 
    
        data/lib/xdg/environment.rb
    CHANGED
    
    | 
         @@ -8,29 +8,17 @@ module XDG 
     | 
|
| 
       8 
8 
     | 
    
         
             
                  @data = Data.new home: home, directories: directories, environment: environment
         
     | 
| 
       9 
9 
     | 
    
         
             
                end
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
     | 
    
         
            -
                def cache_home
         
     | 
| 
       12 
     | 
    
         
            -
                  cache.home
         
     | 
| 
       13 
     | 
    
         
            -
                end
         
     | 
| 
      
 11 
     | 
    
         
            +
                def cache_home = cache.home
         
     | 
| 
       14 
12 
     | 
    
         | 
| 
       15 
     | 
    
         
            -
                def config_home
         
     | 
| 
       16 
     | 
    
         
            -
                  config.home
         
     | 
| 
       17 
     | 
    
         
            -
                end
         
     | 
| 
      
 13 
     | 
    
         
            +
                def config_home = config.home
         
     | 
| 
       18 
14 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
                def config_dirs
         
     | 
| 
       20 
     | 
    
         
            -
                  config.directories
         
     | 
| 
       21 
     | 
    
         
            -
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
                def config_dirs = config.directories
         
     | 
| 
       22 
16 
     | 
    
         | 
| 
       23 
     | 
    
         
            -
                def data_home
         
     | 
| 
       24 
     | 
    
         
            -
                  data.home
         
     | 
| 
       25 
     | 
    
         
            -
                end
         
     | 
| 
      
 17 
     | 
    
         
            +
                def data_home = data.home
         
     | 
| 
       26 
18 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
                def data_dirs
         
     | 
| 
       28 
     | 
    
         
            -
                  data.directories
         
     | 
| 
       29 
     | 
    
         
            -
                end
         
     | 
| 
      
 19 
     | 
    
         
            +
                def data_dirs = data.directories
         
     | 
| 
       30 
20 
     | 
    
         | 
| 
       31 
     | 
    
         
            -
                def inspect
         
     | 
| 
       32 
     | 
    
         
            -
                  "#{cache.inspect} #{config.inspect} #{data.inspect}"
         
     | 
| 
       33 
     | 
    
         
            -
                end
         
     | 
| 
      
 21 
     | 
    
         
            +
                def inspect = "#{cache.inspect} #{config.inspect} #{data.inspect}"
         
     | 
| 
       34 
22 
     | 
    
         | 
| 
       35 
23 
     | 
    
         
             
                private
         
     | 
| 
       36 
24 
     | 
    
         | 
    
        data/lib/xdg/identity.rb
    CHANGED
    
    
    
        data/lib/xdg/pair.rb
    CHANGED
    
    | 
         @@ -5,21 +5,13 @@ module XDG 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
              # A generic key-value pair (KVP).
         
     | 
| 
       7 
7 
     | 
    
         
             
              Pair = Struct.new :key, :value do
         
     | 
| 
       8 
     | 
    
         
            -
                def to_env
         
     | 
| 
       9 
     | 
    
         
            -
                  Hash[*values]
         
     | 
| 
       10 
     | 
    
         
            -
                end
         
     | 
| 
      
 8 
     | 
    
         
            +
                def to_env = Hash[*values]
         
     | 
| 
       11 
9 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
                def key?
         
     | 
| 
       13 
     | 
    
         
            -
                  key.to_s.size.positive?
         
     | 
| 
       14 
     | 
    
         
            -
                end
         
     | 
| 
      
 10 
     | 
    
         
            +
                def key? = key.to_s.size.positive?
         
     | 
| 
       15 
11 
     | 
    
         | 
| 
       16 
     | 
    
         
            -
                def value?
         
     | 
| 
       17 
     | 
    
         
            -
                  value.to_s.size.positive?
         
     | 
| 
       18 
     | 
    
         
            -
                end
         
     | 
| 
      
 12 
     | 
    
         
            +
                def value? = value.to_s.size.positive?
         
     | 
| 
       19 
13 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
                def empty?
         
     | 
| 
       21 
     | 
    
         
            -
                  !(key? && value?)
         
     | 
| 
       22 
     | 
    
         
            -
                end
         
     | 
| 
      
 14 
     | 
    
         
            +
                def empty? = !(key? && value?)
         
     | 
| 
       23 
15 
     | 
    
         | 
| 
       24 
16 
     | 
    
         
             
                def inspect
         
     | 
| 
       25 
17 
     | 
    
         
             
                  return "" unless key? || value?
         
     | 
    
        data/lib/xdg/paths/combined.rb
    CHANGED
    
    | 
         @@ -11,21 +11,13 @@ module XDG 
     | 
|
| 
       11 
11 
     | 
    
         
             
                    @initial_directories = initial_directories
         
     | 
| 
       12 
12 
     | 
    
         
             
                  end
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
     | 
    
         
            -
                  def home
         
     | 
| 
       15 
     | 
    
         
            -
                    initial_home.dynamic
         
     | 
| 
       16 
     | 
    
         
            -
                  end
         
     | 
| 
      
 14 
     | 
    
         
            +
                  def home = initial_home.dynamic
         
     | 
| 
       17 
15 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
                  def directories
         
     | 
| 
       19 
     | 
    
         
            -
                    initial_directories.dynamic
         
     | 
| 
       20 
     | 
    
         
            -
                  end
         
     | 
| 
      
 16 
     | 
    
         
            +
                  def directories = initial_directories.dynamic
         
     | 
| 
       21 
17 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
                  def all
         
     | 
| 
       23 
     | 
    
         
            -
                    directories.prepend home
         
     | 
| 
       24 
     | 
    
         
            -
                  end
         
     | 
| 
      
 18 
     | 
    
         
            +
                  def all = directories.prepend(home)
         
     | 
| 
       25 
19 
     | 
    
         | 
| 
       26 
     | 
    
         
            -
                  def inspect
         
     | 
| 
       27 
     | 
    
         
            -
                    [initial_home.inspect, initial_directories.inspect].reject(&:empty?).join " "
         
     | 
| 
       28 
     | 
    
         
            -
                  end
         
     | 
| 
      
 20 
     | 
    
         
            +
                  def inspect = [initial_home.inspect, initial_directories.inspect].reject(&:empty?).join(" ")
         
     | 
| 
       29 
21 
     | 
    
         | 
| 
       30 
22 
     | 
    
         
             
                  private
         
     | 
| 
       31 
23 
     | 
    
         | 
    
        data/lib/xdg/paths/directory.rb
    CHANGED
    
    | 
         @@ -13,9 +13,7 @@ module XDG 
     | 
|
| 
       13 
13 
     | 
    
         
             
                    @environment = environment
         
     | 
| 
       14 
14 
     | 
    
         
             
                  end
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
     | 
    
         
            -
                  def default
         
     | 
| 
       17 
     | 
    
         
            -
                    value.split(DELIMITER).map { |path| expand path }
         
     | 
| 
       18 
     | 
    
         
            -
                  end
         
     | 
| 
      
 16 
     | 
    
         
            +
                  def default = value.split(DELIMITER).map { |path| expand path }
         
     | 
| 
       19 
17 
     | 
    
         | 
| 
       20 
18 
     | 
    
         
             
                  def dynamic
         
     | 
| 
       21 
19 
     | 
    
         
             
                    String(environment[key]).then { |env_value| env_value.empty? ? value : env_value }
         
     | 
| 
         @@ -24,25 +22,17 @@ module XDG 
     | 
|
| 
       24 
22 
     | 
    
         
             
                                            .map { |path| expand path }
         
     | 
| 
       25 
23 
     | 
    
         
             
                  end
         
     | 
| 
       26 
24 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
                  def inspect
         
     | 
| 
       28 
     | 
    
         
            -
                    [key, dynamic.join(DELIMITER)].reject(&:empty?).join XDG::PAIR_DELIMITER
         
     | 
| 
       29 
     | 
    
         
            -
                  end
         
     | 
| 
      
 25 
     | 
    
         
            +
                  def inspect = [key, dynamic.join(DELIMITER)].reject(&:empty?).join(XDG::PAIR_DELIMITER)
         
     | 
| 
       30 
26 
     | 
    
         | 
| 
       31 
27 
     | 
    
         
             
                  private
         
     | 
| 
       32 
28 
     | 
    
         | 
| 
       33 
29 
     | 
    
         
             
                  attr_reader :pair, :environment
         
     | 
| 
       34 
30 
     | 
    
         | 
| 
       35 
     | 
    
         
            -
                  def key
         
     | 
| 
       36 
     | 
    
         
            -
                    String pair.key
         
     | 
| 
       37 
     | 
    
         
            -
                  end
         
     | 
| 
      
 31 
     | 
    
         
            +
                  def key = String(pair.key)
         
     | 
| 
       38 
32 
     | 
    
         | 
| 
       39 
     | 
    
         
            -
                  def value
         
     | 
| 
       40 
     | 
    
         
            -
                    String pair.value
         
     | 
| 
       41 
     | 
    
         
            -
                  end
         
     | 
| 
      
 33 
     | 
    
         
            +
                  def value = String(pair.value)
         
     | 
| 
       42 
34 
     | 
    
         | 
| 
       43 
     | 
    
         
            -
                  def expand path
         
     | 
| 
       44 
     | 
    
         
            -
                    Pathname(path).expand_path
         
     | 
| 
       45 
     | 
    
         
            -
                  end
         
     | 
| 
      
 35 
     | 
    
         
            +
                  def expand(path) = Pathname(path).expand_path
         
     | 
| 
       46 
36 
     | 
    
         
             
                end
         
     | 
| 
       47 
37 
     | 
    
         
             
              end
         
     | 
| 
       48 
38 
     | 
    
         
             
            end
         
     | 
    
        data/lib/xdg/paths/home.rb
    CHANGED
    
    | 
         @@ -18,29 +18,19 @@ module XDG 
     | 
|
| 
       18 
18 
     | 
    
         
             
                    @environment = environment
         
     | 
| 
       19 
19 
     | 
    
         
             
                  end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
                  def default
         
     | 
| 
       22 
     | 
    
         
            -
                    expand String(value)
         
     | 
| 
       23 
     | 
    
         
            -
                  end
         
     | 
| 
      
 21 
     | 
    
         
            +
                  def default = expand(String(value))
         
     | 
| 
       24 
22 
     | 
    
         | 
| 
       25 
     | 
    
         
            -
                  def dynamic
         
     | 
| 
       26 
     | 
    
         
            -
                    String(environment[key]).then { |path| path.empty? ? default : expand(path) }
         
     | 
| 
       27 
     | 
    
         
            -
                  end
         
     | 
| 
      
 23 
     | 
    
         
            +
                  def dynamic = String(environment[key]).then { |path| path.empty? ? default : expand(path) }
         
     | 
| 
       28 
24 
     | 
    
         | 
| 
       29 
     | 
    
         
            -
                  def inspect
         
     | 
| 
       30 
     | 
    
         
            -
                    [pair.key, dynamic].compact.join XDG::PAIR_DELIMITER
         
     | 
| 
       31 
     | 
    
         
            -
                  end
         
     | 
| 
      
 25 
     | 
    
         
            +
                  def inspect = [pair.key, dynamic].compact.join(XDG::PAIR_DELIMITER)
         
     | 
| 
       32 
26 
     | 
    
         | 
| 
       33 
27 
     | 
    
         
             
                  private
         
     | 
| 
       34 
28 
     | 
    
         | 
| 
       35 
29 
     | 
    
         
             
                  attr_reader :pair, :environment
         
     | 
| 
       36 
30 
     | 
    
         | 
| 
       37 
     | 
    
         
            -
                  def expand path
         
     | 
| 
       38 
     | 
    
         
            -
                    home.join(path).expand_path
         
     | 
| 
       39 
     | 
    
         
            -
                  end
         
     | 
| 
      
 31 
     | 
    
         
            +
                  def expand(path) = home.join(path).expand_path
         
     | 
| 
       40 
32 
     | 
    
         | 
| 
       41 
     | 
    
         
            -
                  def home
         
     | 
| 
       42 
     | 
    
         
            -
                    Pathname environment.fetch(KEY)
         
     | 
| 
       43 
     | 
    
         
            -
                  end
         
     | 
| 
      
 33 
     | 
    
         
            +
                  def home = Pathname(environment.fetch(KEY))
         
     | 
| 
       44 
34 
     | 
    
         
             
                end
         
     | 
| 
       45 
35 
     | 
    
         
             
              end
         
     | 
| 
       46 
36 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: xdg
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version:  
     | 
| 
      
 4 
     | 
    
         
            +
              version: 5.1.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Brooke Kuhlmann
         
     | 
| 
         @@ -10,9 +10,9 @@ bindir: bin 
     | 
|
| 
       10 
10 
     | 
    
         
             
            cert_chain:
         
     | 
| 
       11 
11 
     | 
    
         
             
            - |
         
     | 
| 
       12 
12 
     | 
    
         
             
              -----BEGIN CERTIFICATE-----
         
     | 
| 
       13 
     | 
    
         
            -
              MIIC/ 
     | 
| 
       14 
     | 
    
         
            -
               
     | 
| 
       15 
     | 
    
         
            -
               
     | 
| 
      
 13 
     | 
    
         
            +
              MIIC/jCCAeagAwIBAgIBBDANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
         
     | 
| 
      
 14 
     | 
    
         
            +
              a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0yMTAzMTkxMjQ4MDZaFw0yMjAzMTkx
         
     | 
| 
      
 15 
     | 
    
         
            +
              MjQ4MDZaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
         
     | 
| 
       16 
16 
     | 
    
         
             
              IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6l1qpXTiomH1RfMRloyw7MiE
         
     | 
| 
       17 
17 
     | 
    
         
             
              xyVx/x8Yc3EupdH7uhNaTXQGyORN6aOY//1QXXMHIZ9tW74nZLhesWMSUMYy0XhB
         
     | 
| 
       18 
18 
     | 
    
         
             
              brs+KkurHnc9FnEJAbG7ebGvl/ncqZt72nQvaxpDxvuCBHgJAz+8i5wl6FhLw+oT
         
     | 
| 
         @@ -20,15 +20,15 @@ cert_chain: 
     | 
|
| 
       20 
20 
     | 
    
         
             
              D5vkU0YlAm1r98BymuJlcQ1qdkVEI1d48ph4kcS0S0nv1RiuyVb6TCAR3Nu3VaVq
         
     | 
| 
       21 
21 
     | 
    
         
             
              3fPzZKJLZBx67UvXdbdicWPiUR75elI4PXpLIic3xytaF52ZJYyKZCNZJhNwfQID
         
     | 
| 
       22 
22 
     | 
    
         
             
              AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU0nzow9vc
         
     | 
| 
       23 
     | 
    
         
            -
              2CdikiiE3fJhP/ 
     | 
| 
       24 
     | 
    
         
            -
               
     | 
| 
       25 
     | 
    
         
            -
               
     | 
| 
       26 
     | 
    
         
            -
               
     | 
| 
       27 
     | 
    
         
            -
               
     | 
| 
       28 
     | 
    
         
            -
               
     | 
| 
       29 
     | 
    
         
            -
               
     | 
| 
      
 23 
     | 
    
         
            +
              2CdikiiE3fJhP/gY4ggwDQYJKoZIhvcNAQELBQADggEBAEjpaOXHHp8s/7GL2qCb
         
     | 
| 
      
 24 
     | 
    
         
            +
              YAs7urOLv9VHSPfQWAwaTMVnSsIf3Sw4xzISOP/mmfEPBPXtz61K5esrE/uTFtgb
         
     | 
| 
      
 25 
     | 
    
         
            +
              FyjxQk2H0sEWgrRXGGNHBWQRhhEs7LP/TByoC15A0br++xLxRz4r7HBLGAWQQDpg
         
     | 
| 
      
 26 
     | 
    
         
            +
              66BJ2TBVjxS6K64tKbq7+ACyrOZGgTfNHACh4M076y0x0oRf/rwBrU39/KRfuhbb
         
     | 
| 
      
 27 
     | 
    
         
            +
              cm+nNCEtO35gTmZ2bVDHLGvWazi3gJt6+huQjfXTCUUG2YYBxwhu+GPdAGQPxpf9
         
     | 
| 
      
 28 
     | 
    
         
            +
              lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
         
     | 
| 
      
 29 
     | 
    
         
            +
              W2A=
         
     | 
| 
       30 
30 
     | 
    
         
             
              -----END CERTIFICATE-----
         
     | 
| 
       31 
     | 
    
         
            -
            date:  
     | 
| 
      
 31 
     | 
    
         
            +
            date: 2021-08-07 00:00:00.000000000 Z
         
     | 
| 
       32 
32 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       33 
33 
     | 
    
         
             
            description:
         
     | 
| 
       34 
34 
     | 
    
         
             
            email:
         
     | 
| 
         @@ -67,14 +67,14 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       67 
67 
     | 
    
         
             
              requirements:
         
     | 
| 
       68 
68 
     | 
    
         
             
              - - "~>"
         
     | 
| 
       69 
69 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       70 
     | 
    
         
            -
                  version: ' 
     | 
| 
      
 70 
     | 
    
         
            +
                  version: '3.0'
         
     | 
| 
       71 
71 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       72 
72 
     | 
    
         
             
              requirements:
         
     | 
| 
       73 
73 
     | 
    
         
             
              - - ">="
         
     | 
| 
       74 
74 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       75 
75 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       76 
76 
     | 
    
         
             
            requirements: []
         
     | 
| 
       77 
     | 
    
         
            -
            rubygems_version: 3.2. 
     | 
| 
      
 77 
     | 
    
         
            +
            rubygems_version: 3.2.25
         
     | 
| 
       78 
78 
     | 
    
         
             
            signing_key:
         
     | 
| 
       79 
79 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       80 
80 
     | 
    
         
             
            summary: Provides an implementation of the XDG Base Directory Specification.
         
     | 
    
        metadata.gz.sig
    CHANGED
    
    | 
         Binary file 
     |