summaryrefslogtreecommitdiff
path: root/lib/gitlab/utils.rb
blob: e59ead5d76c6c45cdb91a4c1719073b157d1a9c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Gitlab
  module Utils
    extend self

    # Run system command without outputting to stdout.
    #
    # @param  cmd [Array<String>]
    # @return [Boolean]
    def system_silent(cmd)
      Popen.popen(cmd).last.zero?
    end

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