ruby-usb 0.1.3 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
@@ -0,0 +1,22 @@
1
+ 2009-07-28 Daiki Ueno <ueno@unixuser.org>
2
+
3
+ * extconf.rb: check ruby/st.h for ruby 1.9.
4
+
5
+ * usb.c: prefer ruby/st.h over st.h.
6
+
7
+ 2008-04-12 Tanaka Akira <akr@fsij.org>
8
+
9
+ * ruby-usb 0.2 released.
10
+
11
+ 2007-01-21 Tanaka Akira <akr@fsij.org>
12
+
13
+ * usb.c: include st.h.
14
+ fix a compile error on MacOS X reported by Tony Buser.
15
+
16
+ 2007-01-10 Tanaka Akira <akr@fsij.org>
17
+
18
+ * lib/usb.rb (USB.each_device_by_class): new method.
19
+
20
+ 2007-01-10 Tanaka Akira <akr@fsij.org>
21
+
22
+ * ruby-usb 0.1 released.
@@ -1,17 +1,14 @@
1
- = ruby-usb
2
-
3
- * http://www.a-k-r.org/ruby-usb/
4
- * http://gitorious.org/projects/ruby-usb
5
- * http://ruby-usb.rubyforge.org/
6
-
7
- == DESCRIPTION:
1
+ = ruby-usb - libusb binding for Ruby
8
2
 
9
3
  ruby-usb is a libusb binding library for Ruby.
10
4
 
11
5
  == Author
12
6
 
13
- * Tanaka Akira <akr@fsij.org>
14
- * Aslak Helles�y <aslak.hellesoy@gmail.com> (Gem packaging only)
7
+ Tanaka Akira <akr@fsij.org>
8
+
9
+ == Home Page
10
+
11
+ http://www.a-k-r.org/ruby-usb/
15
12
 
16
13
  == License
17
14
 
@@ -27,22 +24,26 @@ LGPL
27
24
  * ruby : http://www.ruby-lang.org/
28
25
  * libusb 0.1 : http://libusb.sourceforge.net/
29
26
 
30
- == Download
31
-
32
- * latest official release: http://www.a-k-r.org/ruby-usb/ruby-usb-0.1.tar.gz
33
- * development version in Subversion repository:
34
- % svn co svn://svn@svn.a-k-r.org/akr/ruby-usb/trunk ruby-usb
27
+ == Installing via make
35
28
 
36
- == Rubygems install
29
+ * Download:
30
+ ** latest release: http://www.a-k-r.org/ruby-usb/ruby-usb-0.2.tar.gz
31
+ **development version: http://github.com/akr/ruby-usb
37
32
 
38
- gem install ruby-usb
39
-
40
- == Install
33
+ *Install
41
34
 
42
35
  % ruby extconf.rb
43
36
  % make
44
37
  % make install
45
38
 
39
+ == Installing as a gem
40
+
41
+ % gem install ruby-usb
42
+
43
+ On OSX you may need to specify your architecure.
44
+ For example:
45
+ % ARCHFLAGS="-arch x86_64" gem install ruby-usb
46
+
46
47
  == Reference Manual
47
48
 
48
49
  See rdoc/ or
@@ -53,3 +54,4 @@ http://www.a-k-r.org/ruby-usb/rdoc/
53
54
  * USB.org : http://www.usb.org/
54
55
  * AC Power Control through USB : http://www.gniibe.org/ac-power-by-usb/ac-power-control.html
55
56
  * How To Control USB Missile Launcher on Linux : http://blog.taragana.com/index.php/archive/how-to-control-usb-missile-launcher-on-linux/
57
+
data/Rakefile CHANGED
@@ -1,30 +1,19 @@
1
1
  require 'rubygems'
2
- require 'hoe'
2
+ require 'rake'
3
3
 
4
- hoe = Hoe.new('ruby-usb', '0.1.3') do |p|
5
- p.summary = "Tanaka Akira's ruby-usb packaged as gems"
6
- p.remote_rdoc_dir = ''
7
- p.developer('Aslak Hellesøy', 'aslak.hellesoy@gmail.com')
8
- p.developer('Tanaka Akira', 'akr@fsij.org')
9
- p.clean_globs = ['ext/Makefile', 'ext/mkmf.log', 'ext/usb.bundle', 'ext/usb.o', 'ext/usb.so']
10
- p.spec_extras[:dependencies] = lambda do |dependencies|
11
- dependencies.reject!{|dep| dep.name == 'hoe'}
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "ruby-usb"
8
+ gem.summary = %Q{ruby-usb is a libusb binding library for Ruby.}
9
+ gem.email = "akr@fsij.org"
10
+ gem.homepage = "http://github.com/akr/ruby-usb"
11
+ gem.authors = ["Tanaka Akira","Perryn Fowler (0.2.1 gem packaging)"]
12
+ gem.extensions = ["extconf.rb"]
13
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
12
14
  end
15
+ Jeweler::GemcutterTasks.new
16
+ rescue LoadError
17
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
13
18
  end
14
19
 
15
- case RUBY_PLATFORM
16
- when /i386-mingw32/
17
- filename = "ext/usb.so"
18
- file filename do
19
- Dir.chdir("ext") do
20
- ruby "extconf.rb"
21
- system('make')
22
- end
23
- end
24
- desc 'Compile'
25
- task :compile => [filename]
26
- when /i386-mswin32/
27
- hoe.spec.files += ['ext/usb.so']
28
- else
29
- hoe.spec.extensions = ['ext/extconf.rb']
30
- end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.2.1
File without changes
@@ -24,5 +24,6 @@
24
24
  require 'mkmf'
25
25
 
26
26
  have_library("usb", "usb_init")
27
+ have_header("ruby/st.h")
27
28
 
28
29
  create_makefile('usb')
data/lib/usb.rb CHANGED
@@ -410,7 +410,7 @@ module USB
410
410
  result = "\0" * 1024
411
411
  begin
412
412
  self.usb_get_string_simple(index, result)
413
- rescue Errno::EPIPE, Errno::EFBIG, Errno::EPERM
413
+ rescue Errno::EPIPE, Errno::EFBIG, Errno::EPERM, Errno::ERANGE
414
414
  return nil
415
415
  end
416
416
  result.delete!("\0")
@@ -0,0 +1,49 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{ruby-usb}
8
+ s.version = "0.2.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Tanaka Akira", "Perryn Fowler (0.2.1 gem packaging)"]
12
+ s.date = %q{2010-11-27}
13
+ s.email = %q{akr@fsij.org}
14
+ s.extensions = ["extconf.rb"]
15
+ s.extra_rdoc_files = [
16
+ "ChangeLog",
17
+ "README"
18
+ ]
19
+ s.files = [
20
+ ".gitignore",
21
+ "COPYING",
22
+ "ChangeLog",
23
+ "README",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "constants.h",
27
+ "extconf.rb",
28
+ "lib/usb.rb",
29
+ "ruby-usb.gemspec",
30
+ "sample/usb-power",
31
+ "usb.c"
32
+ ]
33
+ s.homepage = %q{http://github.com/akr/ruby-usb}
34
+ s.rdoc_options = ["--charset=UTF-8"]
35
+ s.require_paths = ["lib"]
36
+ s.rubygems_version = %q{1.3.7}
37
+ s.summary = %q{ruby-usb is a libusb binding library for Ruby.}
38
+
39
+ if s.respond_to? :specification_version then
40
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
41
+ s.specification_version = 3
42
+
43
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
44
+ else
45
+ end
46
+ else
47
+ end
48
+ end
49
+
@@ -19,7 +19,11 @@
19
19
  */
20
20
 
21
21
  #include "ruby.h"
22
+ #ifdef HAVE_RUBY_ST_H
23
+ #include "ruby/st.h"
24
+ #else
22
25
  #include "st.h"
26
+ #endif
23
27
  #include <usb.h>
24
28
  #include <errno.h>
25
29
 
metadata CHANGED
@@ -1,70 +1,80 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-usb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ hash: 21
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 1
10
+ version: 0.2.1
5
11
  platform: ruby
6
12
  authors:
7
- - "Aslak Helles\xC3\xB8y"
8
13
  - Tanaka Akira
14
+ - Perryn Fowler (0.2.1 gem packaging)
9
15
  autorequire:
10
16
  bindir: bin
11
17
  cert_chain: []
12
18
 
13
- date: 2008-03-29 23:00:00 +01:00
19
+ date: 2010-11-27 00:00:00 +11:00
14
20
  default_executable:
15
21
  dependencies: []
16
22
 
17
- description: ruby-usb is a libusb binding library for Ruby.
18
- email:
19
- - aslak.hellesoy@gmail.com
20
- - akr@fsij.org
23
+ description:
24
+ email: akr@fsij.org
21
25
  executables: []
22
26
 
23
27
  extensions:
24
- - ext/extconf.rb
28
+ - extconf.rb
25
29
  extra_rdoc_files:
26
- - History.txt
27
- - Manifest.txt
28
- - README.txt
30
+ - ChangeLog
31
+ - README
29
32
  files:
33
+ - .gitignore
30
34
  - COPYING
31
- - History.txt
32
- - Manifest.txt
33
- - README.txt
34
- - README.win32
35
+ - ChangeLog
36
+ - README
35
37
  - Rakefile
36
- - ext/constants.h
37
- - ext/extconf.rb
38
- - ext/usb.c
38
+ - VERSION
39
+ - constants.h
40
+ - extconf.rb
39
41
  - lib/usb.rb
42
+ - ruby-usb.gemspec
40
43
  - sample/usb-power
44
+ - usb.c
41
45
  has_rdoc: true
42
- homepage: http://www.a-k-r.org/ruby-usb/
46
+ homepage: http://github.com/akr/ruby-usb
47
+ licenses: []
48
+
43
49
  post_install_message:
44
50
  rdoc_options:
45
- - --main
46
- - README.txt
51
+ - --charset=UTF-8
47
52
  require_paths:
48
53
  - lib
49
- - ext
50
54
  required_ruby_version: !ruby/object:Gem::Requirement
55
+ none: false
51
56
  requirements:
52
57
  - - ">="
53
58
  - !ruby/object:Gem::Version
59
+ hash: 3
60
+ segments:
61
+ - 0
54
62
  version: "0"
55
- version:
56
63
  required_rubygems_version: !ruby/object:Gem::Requirement
64
+ none: false
57
65
  requirements:
58
66
  - - ">="
59
67
  - !ruby/object:Gem::Version
68
+ hash: 3
69
+ segments:
70
+ - 0
60
71
  version: "0"
61
- version:
62
72
  requirements: []
63
73
 
64
- rubyforge_project: ruby-usb
65
- rubygems_version: 1.0.1
74
+ rubyforge_project:
75
+ rubygems_version: 1.3.7
66
76
  signing_key:
67
- specification_version: 2
68
- summary: Tanaka Akira's ruby-usb packaged as gems
77
+ specification_version: 3
78
+ summary: ruby-usb is a libusb binding library for Ruby.
69
79
  test_files: []
70
80
 
@@ -1,19 +0,0 @@
1
- == 0.1.3 / 2008-03-30
2
-
3
- * Fix broken gem packaging. Aslak Hellesøy <aslak.hellesoy@gmail.com>
4
-
5
- == 0.1.2 / 2008-03-30
6
-
7
- * First gem release on RubyForge. Aslak Hellesøy <aslak.hellesoy@gmail.com>
8
- * Binary gem for Windows
9
- * Source gem for POSIX
10
-
11
- * usb.c: include st.h. Tanaka Akira <akr@fsij.org>
12
- * fix a compile error on MacOS X reported by Tony Buser.
13
-
14
- * lib/usb.rb (USB.each_device_by_class): new method. Tanaka Akira <akr@fsij.org>
15
-
16
- == 0.1 / 2007-01-10
17
-
18
- * First release. Tanaka Akira <akr@fsij.org>
19
-
@@ -1,11 +0,0 @@
1
- COPYING
2
- History.txt
3
- Manifest.txt
4
- README.txt
5
- README.win32
6
- Rakefile
7
- ext/constants.h
8
- ext/extconf.rb
9
- ext/usb.c
10
- lib/usb.rb
11
- sample/usb-power
@@ -1,61 +0,0 @@
1
- = Building Ruby-USB on Windows
2
-
3
- The binaries will work with the Ruby one-click installer, but we have to build everything
4
- with MinGW. This also means we need to build our own Ruby with MinGW.
5
-
6
- == Author of README.win32
7
-
8
- Aslak Hellesøy <aslak.hellesoy@gmail.com>
9
-
10
- == Installing prerequisites
11
- * MinGW and MSYS: http://www.mingw.org/ (MinGW installer and msysCORE-1.0.11-2007.01.19-1.tar.bz2)
12
- * LibUsb-Win32: http://libusb-win32.sourceforge.net/
13
- * Ruby sources
14
-
15
- == Building Ruby with MinGW
16
- put MSYS and MinGW bin on the path, for example:
17
- SET PATH=C:\MinGW\bin;C:\msys\bin;%PATH%
18
-
19
- cd to ruby sources
20
-
21
- sh configure --with-winsock2
22
- make
23
- make install
24
-
25
- You now have a Ruby under c:\usr\local\bin\ruby.exe Try it:
26
-
27
- C:\usr\local\bin\ruby --version
28
- ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mingw32]
29
- (note the [i386-mingw32])
30
-
31
- Now, copy zlib.so and openssl.so from your prebuilt Ruby to the one you built yourself,
32
- your own build won't have it. This is needed in order for Rubygems to work.
33
-
34
- Now you must install rubygems. After you have done that, install hoe:
35
- \usr\local\bin\gem install hoe
36
- You may have to comment out the line in hoe.rb that has `which dot`
37
-
38
- == Prepare for building the native extensions
39
- We must copy the libusb library and header file into ruby-usb.
40
- First, cd to the toplevel dir (the directory of this file)
41
-
42
- cp "C:\Program Files\LibUSB-Win32\lib\msvc\libusb.lib" ext\usb.lib
43
- cp "C:\Program Files\LibUSB-Win32\include\usb.h" ext
44
-
45
- == Build the gem with binary extensions
46
- \usr\local\bin\rake clean compile
47
- rake gem INLINE=1
48
-
49
- == Install the gem in your official ruby (the one from Ruby one-click installer)
50
- gem install pkg\ruby-usb-0.1.3-x86-mswin32.gem
51
-
52
- == Test that it works in your official ruby
53
- > irb
54
- irb(main):001:0> require 'usb'
55
- => true
56
- irb(main):002:0> puts USB.devices.inspect
57
- [#<USB::Device bus-0/\\.\libusb0-0001--0x0a5c-0x2110 0a5c:2110 Broadcom Corp BCM2045B ? (Bluetooth)>, #<USB::Device bus-0/\\.\libusb0-0002--0x0483-0x2016 0483:2016 STMicroelectronics Biometric Coprocessor ? (Vendor specific (00,00))>]
58
-
59
- == Releasing on RubyForge
60
- rake release VERSION=0.1.3
61
- rubyforge add_file ruby-usb ruby-usb 0.1.3 pkg\ruby-usb-0.1.3-x86-mswin32-60.gem