Sha256: 5e1ce70376a28dc34c86b6c6d71551115e3b383c09b0f3fbb6ebba61b7d04a99

Contents?: true

Size: 1.93 KB

Versions: 2

Compression:

Stored size: 1.93 KB

Contents

# This file is part of Libusb for Ruby.
#
# Libusb for Ruby is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Libusb for Ruby is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Libusb for Ruby.  If not, see <http://www.gnu.org/licenses/>.

module LIBUSB
  VERSION = "0.2.1"

  require 'libusb/call'
  require 'libusb/constants'
  require 'libusb/context'
  autoload :Version, 'libusb/version'
  autoload :Configuration, 'libusb/configuration'
  autoload :DevHandle, 'libusb/dev_handle'
  autoload :Device, 'libusb/device'
  autoload :Endpoint, 'libusb/endpoint'
  autoload :Interface, 'libusb/interface'
  autoload :Setting, 'libusb/setting'
  %w[ Transfer BulkTransfer ControlTransfer InterruptTransfer IsoPacket IsochronousTransfer ].each do |klass|
    autoload klass, 'libusb/transfer'
  end

  if Call.respond_to?(:libusb_get_version)
    # Get version of the underlying libusb library.
    # Available since libusb-1.0.10.
    # @return [Version]  version object
    def self.version
      Version.new(Call.libusb_get_version)
    end
  end

  if Call.respond_to?(:libusb_has_capability)
    # Check at runtime if the loaded library has a given capability.
    # Available since libusb-1.0.9.
    # @param [Symbol] capability  the {Call::Capabilities Capabilities} symbol to check for
    # @return [Boolean]  +true+ if the running library has the capability, +false+ otherwise
    def self.has_capability?(capability)
      r = Call.libusb_has_capability(capability)
      return r != 0
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
libusb-0.2.1-x86-mingw32 lib/libusb.rb
libusb-0.2.1 lib/libusb.rb