[DRE-commits] [ruby-cucumber-core] 01/05: add unindent.rb upstream file for testing purposes
Cédric Boutillier
boutil at moszumanska.debian.org
Thu May 28 11:58:55 UTC 2015
This is an automated email from the git hooks/post-receive script.
boutil pushed a commit to branch master
in repository ruby-cucumber-core.
commit b33a165bcd694bffd5f4daf833fc1c1fa6c8b7ee
Author: Cédric Boutillier <boutil at debian.org>
Date: Wed Apr 29 10:37:52 2015 +0200
add unindent.rb upstream file for testing purposes
---
debian/unindent.rb | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/debian/unindent.rb b/debian/unindent.rb
new file mode 100644
index 0000000..95758f2
--- /dev/null
+++ b/debian/unindent.rb
@@ -0,0 +1,14 @@
+# Copyright © 2009 Martin Aumont (mynyml)
+# Licence Expat
+# https://github.com/mynyml/unindent/blob/master/lib/unindent.rb
+# https://github.com/mynyml/unindent/blob/master/LICENSE
+
+class String
+ def unindent
+ indent = self.split("\n").select {|line| !line.strip.empty? }.map {|line| line.index(/[^\s]/) }.compact.min || 0
+ self.gsub(/^[[:blank:]]{#{indent}}/, '')
+ end
+ def unindent!
+ self.replace(self.unindent)
+ end
+end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-cucumber-core.git
More information about the Pkg-ruby-extras-commits
mailing list