[SCM] ci-tooling packaging branch, master, updated. 3f1756534e7921276fdaa3c4bf98b66c786c4d56
Harald Sitter
apachelogger-guest at moszumanska.debian.org
Tue Nov 10 11:41:06 UTC 2015
Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=276300d
The following commit has been merged in the master branch:
commit 276300d4a9487bb200d6e7f80ce94b6e436cebf5
Author: Harald Sitter <sitter at kde.org>
Date: Tue Nov 10 12:37:54 2015 +0100
dry dci and kci data file loading
xci now assumes the config file is named like the final module in downcase
i.e. module KCI -> kci.yaml etc.
this allows us to have 0 code in the specific modules beyond what would
be specific to the modules anyway
---
lib/dci.rb | 8 --------
lib/kci.rb | 8 --------
lib/xci.rb | 10 ++++++++++
3 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/lib/dci.rb b/lib/dci.rb
index b59d007..23b2a8d 100644
--- a/lib/dci.rb
+++ b/lib/dci.rb
@@ -23,12 +23,4 @@ end
# Debian CI specific data.
module DCI
extend XCI
-
- private
-
- def self.data
- return @data if defined?(@data)
- file = File.join(File.dirname(__dir__), 'data', 'dci.yaml')
- @data = YAML.load(File.read(file))
- end
end
diff --git a/lib/kci.rb b/lib/kci.rb
index 3dea356..cf69b81 100644
--- a/lib/kci.rb
+++ b/lib/kci.rb
@@ -3,12 +3,4 @@ require_relative 'xci'
# Kubuntu CI specific data.
module KCI
extend XCI
-
- private
-
- def self.data
- return @data if defined?(@data)
- file = File.join(File.dirname(__dir__), 'data', 'kci.yaml')
- @data = YAML.load(File.read(file))
- end
end
diff --git a/lib/xci.rb b/lib/xci.rb
index 2b7d473..db8dc5e 100644
--- a/lib/xci.rb
+++ b/lib/xci.rb
@@ -62,4 +62,14 @@ module XCI
def sort_version_hash(hash)
hash.sort_by { |_, version| Gem::Version.new(version) }
end
+
+ def data_file_name
+ @data_file_name ||= "#{to_s.downcase}.yaml"
+ end
+
+ def data
+ return @data if defined?(@data)
+ file = File.join(File.dirname(__dir__), 'data', data_file_name)
+ @data = YAML.load(File.read(file))
+ end
end
--
ci-tooling packaging
More information about the pkg-kde-commits
mailing list