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

Version Path
fontist-1.20.0 exe/fontist
fontist-1.19.0 exe/fontist
fontist-1.18.2 exe/fontist
fontist-1.17.1 exe/fontist
fontist-1.17.0 exe/fontist
fontist-1.16.0 exe/fontist
fontist-1.15.2 exe/fontist
fontist-1.15.1 exe/fontist
fontist-1.15.0 exe/fontist
fontist-1.14.6 exe/fontist
fontist-1.14.5 exe/fontist
fontist-1.14.4 exe/fontist
fontist-1.14.3 exe/fontist
fontist-1.14.2 exe/fontist
fontist-1.14.1 exe/fontist
fontist-1.14.0 exe/fontist
fontist-1.13.2 exe/fontist
fontist-1.13.1 exe/fontist
fontist-1.13.0 exe/fontist
fontist-1.12.0 exe/fontist