summaryrefslogtreecommitdiff
path: root/lib/utils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils.rb')
-rw-r--r--lib/utils.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/utils.rb b/lib/utils.rb
new file mode 100644
index 00000000000..6e7460ed99a
--- /dev/null
+++ b/lib/utils.rb
@@ -0,0 +1,8 @@
+module Utils
+ def self.binary?(string)
+ string.each_byte do |x|
+ x.nonzero? or return true
+ end
+ false
+ end
+end