# File lib/terminal-notifier.rb, line 18 def self.execute(verbose, options) if available? command = [BIN_PATH, *options.map { |k,v| v = v.to_s; ["-#{k}", "#{v[0] == "-" ? " " : ""}#{Shellwords.escape(v[0,1])}#{v[1..-1]}"] }.flatten] command = Shellwords.join(command) if RUBY_VERSION < '1.9' result = '' IO.popen(command) do |stdout| output = stdout.read STDOUT.print output if verbose result << output end result else STDERR.print "terminal-notifier is only supported on macOS 10.10, or higher." end end