summarylogtreecommitdiffstats
path: root/xdg.patch
blob: 274f39a4d3aba667f27a38e8e92227e5f7c05917 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff --git a/lib/tmuxinator/config.rb b/lib/tmuxinator/config.rb
index d14eb9a..d4eccaa 100644
--- a/lib/tmuxinator/config.rb
+++ b/lib/tmuxinator/config.rb
@@ -29,7 +29,7 @@ module Tmuxinator
       # a custom value. (e.g. if $XDG_CONFIG_HOME is set to ~/my-config, the
       # return value will be ~/my-config/tmuxinator)
       def xdg
-        XDG["CONFIG"].to_s + "/tmuxinator"
+        XDG::Config.new.home.to_s + "/tmuxinator"
       end
 
       def xdg?
diff --git a/spec/lib/tmuxinator/config_spec.rb b/spec/lib/tmuxinator/config_spec.rb
index 09ab25f..9d6d7e2 100644
--- a/spec/lib/tmuxinator/config_spec.rb
+++ b/spec/lib/tmuxinator/config_spec.rb
@@ -53,7 +53,8 @@ describe Tmuxinator::Config do
 
         Dir.mktmpdir do |dir|
           config_parent = "#{dir}/non_existent_parent/s"
-          allow(XDG).to receive(:[]).with("CONFIG").and_return config_parent
+          allow(XDG::Config).to receive_message_chain(:new, :home, :to_s).
+            and_return config_parent
           expect(described_class.directory).
             to eq "#{config_parent}/tmuxinator"
           expect(File.directory?("#{config_parent}/tmuxinator")).to be true
@@ -134,7 +135,8 @@ describe Tmuxinator::Config do
 
   describe "#xdg" do
     it "is $XDG_CONFIG_HOME/tmuxinator" do
-      expect(described_class.xdg).to eq "#{XDG['CONFIG_HOME']}/tmuxinator"
+      config_home = XDG::Config.new.home.to_s
+      expect(described_class.xdg).to eq "#{config_home}/tmuxinator"
     end
   end
 
diff --git a/tmuxinator.gemspec b/tmuxinator.gemspec
index df933d8..f8e9fe7 100644
--- a/tmuxinator.gemspec
+++ b/tmuxinator.gemspec
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
 
   s.add_dependency "erubis", "~> 2.6"
   s.add_dependency "thor", "~> 1.3.0"
-  s.add_dependency "xdg", "~> 2.2", ">= 2.2.5"
+  s.add_dependency "xdg", ">= 4.3.0"
 
   s.add_development_dependency "activesupport", "< 5.0.0" # Please see issue #432
   s.add_development_dependency "awesome_print", "~> 1.2"