Module: Gitlab::Utils

Extended by:
Utils
Included in:
Utils
Defined in:
lib/gitlab/utils.rb

Instance Method Summary collapse

Instance Method Details

#force_utf8(str) ⇒ Object


13
14
15
# File 'lib/gitlab/utils.rb', line 13

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

#system_silent(cmd) ⇒ Boolean

Run system command without outputting to stdout.

Parameters:

  • cmd (Array<String>)

Returns:

  • (Boolean)

9
10
11
# File 'lib/gitlab/utils.rb', line 9

def system_silent(cmd)
  Popen::popen(cmd).last.zero?
end