libusb 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ 0.3.2 / 2013-02-16
2
+ ------------------
3
+ * Don't enforces DevKit installation on Windows.
4
+ * Fix error check on libusb_get_device_list(). Thanks to Paul Kunysch for the bug report.
5
+ * Add support for Cygwin. Requires ffi-1.4.0.
6
+
1
7
  0.3.1 / 2013-01-22
2
8
  ------------------
3
9
  * Fix loading of compiled libusb library on OSX
data/Rakefile CHANGED
@@ -132,7 +132,8 @@ task :cross => [ :mingw32, :libusb_dll ] do |t|
132
132
  spec.instance_variable_set(:"@cache_file", nil) if spec.respond_to?(:cache_file)
133
133
  spec.platform = Gem::Platform.new('i386-mingw32')
134
134
  spec.files << "lib/#{File.basename(LIBUSB_DLL)}"
135
- spec.files -= `git ls-files ext/libusbx-*`.split("\n")
135
+ spec.files -= `git ls-files ext`.split("\n")
136
+ spec.extensions = []
136
137
 
137
138
  # Generate a package for this gem
138
139
  Gem::PackageTask.new(spec) do |pkg|
@@ -6,9 +6,13 @@ require 'ffi'
6
6
  begin
7
7
  module LibTest
8
8
  extend FFI::Library
9
+
10
+ root_path = File.expand_path("../..", __FILE__)
9
11
  ext = FFI::Platform::LIBSUFFIX
10
- bundled_dll = File.expand_path("../../lib/libusb-1.0.#{ext}", __FILE__)
11
- ffi_lib(['libusb-1.0', bundled_dll])
12
+ prefix = FFI::Platform::LIBPREFIX.empty? ? 'lib' : FFI::Platform::LIBPREFIX
13
+ bundled_dll = File.join(root_path, "lib/#{prefix}usb-1.0.#{ext}")
14
+ bundled_dll_cygwin = File.join(root_path, "bin/#{prefix}usb-1.0.#{ext}")
15
+ ffi_lib(["#{prefix}usb-1.0", bundled_dll, bundled_dll_cygwin])
12
16
  end
13
17
  rescue LoadError
14
18
  # Unable to load libusb library on this system,
@@ -23,9 +23,12 @@ module LIBUSB
23
23
  module Call
24
24
  extend FFI::Library
25
25
 
26
+ root_path = File.expand_path("../../..", __FILE__)
26
27
  ext = FFI::Platform::LIBSUFFIX
27
- bundled_dll = File.expand_path("../../libusb-1.0.#{ext}", __FILE__)
28
- ffi_lib(['libusb-1.0', bundled_dll])
28
+ prefix = FFI::Platform::LIBPREFIX.empty? ? 'lib' : FFI::Platform::LIBPREFIX
29
+ bundled_dll = File.join(root_path, "lib/#{prefix}usb-1.0.#{ext}")
30
+ bundled_dll_cygwin = File.join(root_path, "bin/#{prefix}usb-1.0.#{ext}")
31
+ ffi_lib(["#{prefix}usb-1.0", bundled_dll, bundled_dll_cygwin])
29
32
 
30
33
  ClassCodes = enum :libusb_class_code, [
31
34
  :CLASS_PER_INTERFACE, 0,
@@ -165,7 +168,7 @@ module LIBUSB
165
168
  attach_function 'libusb_set_debug', [:pointer, :int], :void
166
169
  try_attach_function 'libusb_has_capability', [:libusb_capability], :int
167
170
 
168
- attach_function 'libusb_get_device_list', [:pointer, :pointer], :size_t
171
+ attach_function 'libusb_get_device_list', [:pointer, :pointer], :ssize_t
169
172
  attach_function 'libusb_free_device_list', [:pointer, :int], :void
170
173
  attach_function 'libusb_ref_device', [:pointer], :pointer
171
174
  attach_function 'libusb_unref_device', [:pointer], :void
@@ -15,5 +15,5 @@
15
15
 
16
16
  module LIBUSB
17
17
  # Library version of libusb for Ruby
18
- VERSION = "0.3.1"
18
+ VERSION = "0.3.2"
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libusb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-22 00:00:00.000000000 Z
12
+ date: 2013-02-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -197,4 +197,3 @@ signing_key:
197
197
  specification_version: 3
198
198
  summary: Access USB devices from Ruby via libusb-1.0
199
199
  test_files: []
200
- has_rdoc: