[SCM] ci-tooling packaging branch, master, updated. 2c152282d215f616430a52900b425666e97c5f08

Rohan Garg rohangarg-guest at moszumanska.debian.org
Tue Nov 3 12:36:30 UTC 2015


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

The following commit has been merged in the master branch:
commit 2c152282d215f616430a52900b425666e97c5f08
Author: Rohan Garg <rohan at garg.io>
Date:   Tue Nov 3 13:30:30 2015 +0100

    Split out Shebang class
---
 test/lib/shebang.rb | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/test/lib/shebang.rb b/test/lib/shebang.rb
new file mode 100644
index 0000000..6f126b9
--- /dev/null
+++ b/test/lib/shebang.rb
@@ -0,0 +1,26 @@
+class Shebang
+  attr_reader :valid
+  attr_reader :parser
+
+  def initialize(line)
+    @valid = false
+    @parser = nil
+
+    return unless line
+    return unless line.start_with?('#!')
+
+    parts = line.split(' ')
+
+    return unless parts.size >= 1
+    if parts[0].end_with?('/env')
+      return unless parts.size >= 2
+      @parser = parts[1]
+    elsif !parts[0].include?('/') || parts[0].end_with?('/')
+      return # invalid
+    else
+      @parser = parts[0].split('/').pop
+    end
+
+    @valid = true
+  end
+end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list