BigW Consortium Gitlab

utils.rb 320 Bytes
Newer Older
1 2 3 4 5 6 7
module Gitlab
  module Utils
    extend self

    # Run system command without outputting to stdout.
    #
    # @param  cmd [Array<String>]
Valery Sizov committed
8
    # @return [Boolean]
9
    def system_silent(cmd)
Valery Sizov committed
10
      Popen::popen(cmd).last.zero?
11
    end
12 13 14 15

    def force_utf8(str)
      str.force_encoding(Encoding::UTF_8)
    end
16 17
  end
end