lib/travis/tools/safe_string.rb in travis-1.11.1 vs lib/travis/tools/safe_string.rb in travis-1.12.0
- old
+ new
@@ -1,11 +1,14 @@
+# frozen_string_literal: true
+
module Travis
module Tools
module SafeString
- extend self
+ module_function
def encoded(string)
return string unless string.respond_to? :encode
+
string.encode 'utf-8'
rescue Encoding::UndefinedConversionError
string.force_encoding 'utf-8'
end