Sha256: 86a2de9892437f9ca20b994b0f70c4a14957c87ad410092f64e0d6484b31ab89
Contents?: true
Size: 695 Bytes
Versions: 27
Compression:
Stored size: 695 Bytes
Contents
#!/usr/bin/env ruby require "fontist" require "fontist/cli" fontist_cli = proc { status_code = Fontist::CLI.start(ARGV) exit status_code.is_a?(Integer) ? status_code : 1 } if ENV["SOCKS_PROXY"] require "socksify" require "uri" begin proxy = URI.parse(ENV["SOCKS_PROXY"]) if proxy.userinfo user, pass = proxy.userinfo.split(":") TCPSocket::socks_username = user TCPSocket::socks_password = pass end Socksify::proxy(proxy.host, proxy.port, &fontist_cli) rescue URI::InvalidURIError warn "Value of ENV.SOCKS_PROXY=#{ENV['SOCKS_PROXY']} is invalid! Droping it" ENV.delete("SOCKS_PROXY") fontist_cli.call end else fontist_cli.call end
Version data entries
27 entries across 27 versions & 1 rubygems