diff --git a/.ruby-gemset b/.ruby-gemset new file mode 100644 index 0000000..642acd8 --- /dev/null +++ b/.ruby-gemset @@ -0,0 +1 @@ +blinkstick diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..cb50681 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.0.0-p247 diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..bc54542 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source "http://rubygems.org" + +gem "libusb" +gem "color" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..ffb6ad9 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,14 @@ +GEM + remote: http://rubygems.org/ + specs: + color (1.4.2) + ffi (1.9.3) + libusb (0.4.0) + ffi (>= 1.0) + +PLATFORMS + ruby + +DEPENDENCIES + color + libusb diff --git a/README.md b/README.md index c1b8dcd..bb596e5 100644 --- a/README.md +++ b/README.md @@ -28,14 +28,29 @@ Description of files: * blinkstick.rb - main BlinkStick class definition * example-info.rb - displays information of each BlinkStick -* example-infoblock.rb - read/write info block sample +* example-infoblock.rb - read/write info block sample * example-off.rb - turn all blinksticks off * example-random.rb - set random color to all blinksticks Running examples: ```sh -ruby example-info.py +ruby examples/example-info.rb +``` + +Usage +----- + +Add gem "blinkstick" to your Gemfile. +```gem "blinkstick"``` + +``` +require "blinkstick" + +BlinkStick.find_all.each { | b | + b.random_color + puts b.serial + ": " + b.color.html +} ``` Permission problems diff --git a/blinkstick.gemspec b/blinkstick.gemspec new file mode 100644 index 0000000..cfa8193 --- /dev/null +++ b/blinkstick.gemspec @@ -0,0 +1,23 @@ +# -*- encoding: utf-8 -*- + $:.push File.expand_path("../lib", __FILE__) + require "blinkstick/version" + +Gem::Specification.new do |s| + s.name = "blinkstick" + s.version = BlinkStick::VERSION + s.date = "2014-01-02" + s.summary = "Blinkstick" + s.description = <<-DESC + BlinkStick provides a ruby interface to an Agile Innovative BlinkStick via libusb. + DESC + s.files = Dir.glob("{lib}/**/*") + s.require_path = "lib" + + s.homepage = "https://github.com/arvydas/blinkstick-ruby" + s.email = "arvydas@agileinnovative.co.uk" + s.authors = ["Arvydas Juskevicius"] + + s.add_runtime_dependency "libusb", [">= 0.4.0"] + s.add_runtime_dependency "color", [">= 1.4.2"] +end + diff --git a/example-find.rb b/examples/example-find.rb similarity index 100% rename from example-find.rb rename to examples/example-find.rb diff --git a/example-info.rb b/examples/example-info.rb similarity index 100% rename from example-info.rb rename to examples/example-info.rb diff --git a/example-infoblock.rb b/examples/example-infoblock.rb similarity index 100% rename from example-infoblock.rb rename to examples/example-infoblock.rb diff --git a/example-off.rb b/examples/example-off.rb similarity index 100% rename from example-off.rb rename to examples/example-off.rb diff --git a/example-random.rb b/examples/example-random.rb similarity index 100% rename from example-random.rb rename to examples/example-random.rb diff --git a/blinkstick.rb b/lib/blinkstick.rb similarity index 100% rename from blinkstick.rb rename to lib/blinkstick.rb diff --git a/lib/blinkstick/version.rb b/lib/blinkstick/version.rb new file mode 100644 index 0000000..1a184f8 --- /dev/null +++ b/lib/blinkstick/version.rb @@ -0,0 +1,3 @@ +class BlinkStick + VERSION = "1.0.1" +end