Sha256: 3ea30175e991317e36e49df154b94178b80b0186d9619a03eb59c077f2d8b8bb

Contents?: true

Size: 434 Bytes

Versions: 2

Compression:

Stored size: 434 Bytes

Contents

# frozen_string_literal: true

require_relative "idnx/version"
require "ffi"

module Idnx
  class Error < StandardError; end

  module_function

  def to_punycode(hostname)
    Lib.lookup(hostname)
  end
end

if FFI::Platform.windows?
  require "idnx/windows"
else
  begin
    require "idnx/idn2"
  rescue LoadError
    # fallback to pure ruby punycode 2003 implementation
    require "idnx/ruby"
    Idnx::Lib = Idnx::Ruby
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
idnx-0.1.1 lib/idnx.rb
idnx-0.1.0 lib/idnx.rb