diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c1e0daf --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +## MAC OS +.DS_Store + +## TEXTMATE +*.tmproj +tmtags + +## EMACS +*~ +\#* +.\#* + +## VIM +*.swp + +## PROJECT::GENERAL +coverage +rdoc +pkg + +## PROJECT::SPECIFIC diff --git a/README b/README index 1fbafbe..6fb8d3b 100644 --- a/README +++ b/README @@ -24,18 +24,26 @@ LGPL * ruby : http://www.ruby-lang.org/ * libusb 0.1 : http://libusb.sourceforge.net/ -== Download +== Installing via make -* latest release: http://www.a-k-r.org/ruby-usb/ruby-usb-0.2.tar.gz +* Download: +** latest release: http://www.a-k-r.org/ruby-usb/ruby-usb-0.2.tar.gz +**development version: http://github.com/akr/ruby-usb -* development version: http://github.com/akr/ruby-usb - -== Install +*Install % ruby extconf.rb % make % make install +== Installing as a gem + + % gem install ruby-usb + +On OSX you may need to specify your architecure. +For example: + % ARCHFLAGS="-arch x86_64" gem install ruby-usb + == Reference Manual See rdoc/ or @@ -46,3 +54,4 @@ http://www.a-k-r.org/ruby-usb/rdoc/ * USB.org : http://www.usb.org/ * AC Power Control through USB : http://www.gniibe.org/ac-power-by-usb/ac-power-control.html * How To Control USB Missile Launcher on Linux : http://blog.taragana.com/index.php/archive/how-to-control-usb-missile-launcher-on-linux/ + diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..82250c4 --- /dev/null +++ b/Rakefile @@ -0,0 +1,19 @@ +require 'rubygems' +require 'rake' + +begin + require 'jeweler' + Jeweler::Tasks.new do |gem| + gem.name = "ruby-usb" + gem.summary = %Q{ruby-usb is a libusb binding library for Ruby.} + gem.email = "akr@fsij.org" + gem.homepage = "http://github.com/akr/ruby-usb" + gem.authors = ["Tanaka Akira","Perryn Fowler (0.2.1 gem packaging)"] + gem.extensions = ["extconf.rb"] + # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings + end + Jeweler::GemcutterTasks.new +rescue LoadError + puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" +end + diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..0c62199 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.2.1 diff --git a/lib/usb.rb b/lib/usb.rb index 1d8ae5f..7e3b1f5 100644 --- a/lib/usb.rb +++ b/lib/usb.rb @@ -410,7 +410,7 @@ def get_string_simple(index) result = "\0" * 1024 begin self.usb_get_string_simple(index, result) - rescue Errno::EPIPE, Errno::EFBIG, Errno::EPERM + rescue Errno::EPIPE, Errno::EFBIG, Errno::EPERM, Errno::ERANGE return nil end result.delete!("\0") diff --git a/ruby-usb.gemspec b/ruby-usb.gemspec new file mode 100644 index 0000000..5d70483 --- /dev/null +++ b/ruby-usb.gemspec @@ -0,0 +1,49 @@ +# Generated by jeweler +# DO NOT EDIT THIS FILE DIRECTLY +# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = %q{ruby-usb} + s.version = "0.2.1" + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.authors = ["Tanaka Akira", "Perryn Fowler (0.2.1 gem packaging)"] + s.date = %q{2010-11-27} + s.email = %q{akr@fsij.org} + s.extensions = ["extconf.rb"] + s.extra_rdoc_files = [ + "ChangeLog", + "README" + ] + s.files = [ + ".gitignore", + "COPYING", + "ChangeLog", + "README", + "Rakefile", + "VERSION", + "constants.h", + "extconf.rb", + "lib/usb.rb", + "ruby-usb.gemspec", + "sample/usb-power", + "usb.c" + ] + s.homepage = %q{http://github.com/akr/ruby-usb} + s.rdoc_options = ["--charset=UTF-8"] + s.require_paths = ["lib"] + s.rubygems_version = %q{1.3.7} + s.summary = %q{ruby-usb is a libusb binding library for Ruby.} + + if s.respond_to? :specification_version then + current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION + s.specification_version = 3 + + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then + else + end + else + end +end +