Sha256: 53ea45c7285dbbff59bff9b6e8ff9177b158490e2d715039d03d128716480bd5

Contents?: true

Size: 629 Bytes

Versions: 2

Compression:

Stored size: 629 Bytes

Contents

#!/usr/bin/env ruby

require "fontist"
require "fontist/cli"

fontist_cli = proc {
  Fontist::CLI.start(ARGV)
}

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

2 entries across 2 versions & 1 rubygems

Version Path
fontist-1.21.2 exe/fontist
fontist-1.21.1 exe/fontist