[SCM] ci-tooling packaging branch, master, updated. 42ce3c1cdfb33ae2505a61f50f8158fc438a8e44

Rohan Garg rohangarg-guest at moszumanska.debian.org
Wed Sep 9 16:10:50 UTC 2015


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

The following commit has been merged in the master branch:
commit 42ce3c1cdfb33ae2505a61f50f8158fc438a8e44
Author: Rohan Garg <rohan at garg.io>
Date:   Wed Sep 9 15:17:29 2015 +0200

    Make lib/kci.rb more generic for both DCI and KCI
---
 lib/kci.rb | 34 ++++++++++++++++++++++++----------
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/lib/kci.rb b/lib/kci.rb
index f56d615..b0e0c1a 100644
--- a/lib/kci.rb
+++ b/lib/kci.rb
@@ -2,20 +2,20 @@ require 'yaml'
 require 'ostruct'
 
 # Kubuntu CI specific stuff.
-module KCI
+module CI
   # @param sort [Symbol] sorting applied to hash
   #   - *:none* No sorting, arbitrary order as in config itself (fastest)
   #   - *:ascending* Oldest version comes first (i.e. [15.04, 15.10])
   #   - *:descending* Oldest version comes last (i.e. [15.10, 15.04])
   # @return [Hash] distribution series
-  def self.series(sort: :none)
+  def series(sort: :none)
     return sort_version_hash(data['series']).to_h if sort == :ascending
     return sort_version_hash(data['series']).reverse.to_h if sort == :descending
     data['series']
   end
 
   # @return [String] name of the latest (i.e. newest) series
-  def self.latest_series
+  def latest_series
     @latest_series ||= series(sort: :descending).keys.first
   end
 
@@ -24,7 +24,7 @@ module KCI
   # This for example are general purpose architectures such as i386/amd64.
   # @see .extra_architectures
   # @return [Array<String>] architectures to integrate
-  def self.architectures
+  def architectures
     data['architectures']
   end
 
@@ -34,7 +34,7 @@ module KCI
   # @see .all_architectures
   # @return [Array<String>] architectures to only integrated when explicitly
   #   enabled within the context of a build.
-  def self.extra_architectures
+  def extra_architectures
     data['extra_architectures']
   end
 
@@ -47,25 +47,39 @@ module KCI
   # @see .architectures
   # @see .extra_architectures
   # @return [Array<String>] all architectures
-  def self.all_architectures
+  def all_architectures
     architectures + extra_architectures
   end
 
   # @return [Array<String>] types to integrate (stable/unstable)
-  def self.types
+  def types
     data['types']
   end
 
   private
 
+  # @return [Array] array can be converted back with to_h
+  def sort_version_hash(hash)
+    hash.sort_by { |_, version| Gem::Version.new(version) }
+  end
+end
+
+module KCI
+  extend CI
+  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
 
-  # @return [Array] array can be converted back with to_h
-  def self.sort_version_hash(hash)
-    hash.sort_by { |_, version| Gem::Version.new(version) }
+module DCI
+  extend CI
+  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

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list