[SCM] ci-tooling packaging branch, master, updated. 8fe5785fd2e67dd6583216e9c0f1d930731cb587

Harald Sitter apachelogger-guest at moszumanska.debian.org
Tue May 12 08:29:49 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=8fe5785

The following commit has been merged in the master branch:
commit 8fe5785fd2e67dd6583216e9c0f1d930731cb587
Author: Harald Sitter <sitter at kde.org>
Date:   Tue May 12 10:29:40 2015 +0200

    use ruby2 __dir__ to resolve kci properly through the kci/lib symlink
---
 lib/kci.rb       | 6 +-----
 test/test_kci.rb | 5 ++++-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/lib/kci.rb b/lib/kci.rb
index f506a7d..67505f0 100644
--- a/lib/kci.rb
+++ b/lib/kci.rb
@@ -21,12 +21,8 @@ module KCI
   private
 
   def self.data
-    # FIXME: since kci has a link to lib from inside kci/ the path resolution
-    # is wrong when required via there. needs symlink resolution on the file
-    # I think.
     return @data if defined?(@data)
-    base = File.expand_path(File.dirname(File.dirname(__FILE__)))
-    file = File.join(base, 'data', 'kci.yaml')
+    file = File.join(File.dirname(__dir__), 'data', 'kci.yaml')
     @data = YAML.load(File.read(file))
   end
 
diff --git a/test/test_kci.rb b/test/test_kci.rb
index f9fdfed..c711ced 100644
--- a/test/test_kci.rb
+++ b/test/test_kci.rb
@@ -1,5 +1,8 @@
-require_relative '../lib/kci'
 require_relative 'lib/testcase'
+# Require kci through the kci/lib symlink to make sure path resolution works
+# even with the changed relativity towards data/.
+# i.e. ../data/kci.yaml is ../../data/kci.yaml within that symlink context
+require_relative '../kci/lib/kci'
 
 # Test kci
 class KCITest < TestCase

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list