From b6a4dafcd60a61941b6eb4e055f55fd8114bc3b9 Mon Sep 17 00:00:00 2001 From: Joe Haig Date: Fri, 15 Aug 2014 12:32:10 +0100 Subject: [PATCH 1/2] Fix ext libraries. Also tidy up the README file and convert to Markdown --- README => README.md | 14 ++++++++------ ext/wiringpi/extconf.rb | 1 + wiringpi.gemspec | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) rename README => README.md (84%) diff --git a/README b/README.md similarity index 84% rename from README rename to README.md index d4e4e4d..cf6c094 100644 --- a/README +++ b/README.md @@ -1,16 +1,18 @@ +# WiringPi-Ruby + WiringPi: An implementation of most of the Arduino Wiring functions for the Raspberry Pi WiringPiGem: The WiringPi library wrapped up for Ruby with some OO goodness, sanity checking and other handy additions. -WiringPi GPIO: +## WiringPi GPIO: require 'wiringpi' io = WiringPi::GPIO.new io.write(pin,value) io.read(pin,value) - Shift out: +### Shift out: io.write(latch_pin, LOW) io.shiftOut(data_pin, clock_pin, LSBFIRST or MSBFIRST, value) @@ -20,15 +22,15 @@ WiringPi GPIO: io.shiftOutArray(data_pin, clock_pin, latch_pin, [0,1,0,0,1,1,1,0]) -WiringPi GPIO with /sys/class/gpio: +## WiringPi GPIO with /sys/class/gpio: - require 'wiringpi + require 'wiringpi' io = WiringPi::GPIO.new(WPI_MODE_SYS) # read/write/shift as usual -WiringPi Serial: +## WiringPi Serial: -require 'wiringpi' + require 'wiringpi' s = WiringPi::Serial.new('/dev/ttyAMA0',9600) s.serialPuts('Hello world!') s.serialClose diff --git a/ext/wiringpi/extconf.rb b/ext/wiringpi/extconf.rb index 4b8fc66..427a6fd 100755 --- a/ext/wiringpi/extconf.rb +++ b/ext/wiringpi/extconf.rb @@ -4,6 +4,7 @@ $objs = $srcs.map{ |file| file.sub('.c','.o') } $srcs << 'wiringpi_wrap.c' $objs << 'wiringpi_wrap.o' +$libs << '-lwiringPi' create_makefile('wiringpi/wiringpi') diff --git a/wiringpi.gemspec b/wiringpi.gemspec index a83f443..a31f6ed 100644 --- a/wiringpi.gemspec +++ b/wiringpi.gemspec @@ -7,7 +7,7 @@ Gem::Specification.new do |s| s.summary = "Arduino wiring-like library for Raspberry Pi GPIO. Will only work on a Pi. Alpha version." s.authors = ["Gordon","Phil"] s.email = 'phil@gadgetoid.com' - s.files = Dir.glob('lib/*.rb') + Dir.glob('ext/**/**/*.{c,h}') + Dir.glob('ext/**/*.{c,h,rb}') + s.files = Dir.glob('lib/*.rb') + Dir.glob('lib/wiringpi/.keep') + Dir.glob('ext/**/**/*.{c,h}') + Dir.glob('ext/**/*.{c,h,rb}') s.homepage = 'http://rubygems.org/gems/wiringpi' s.extensions = ['ext/wiringpi/extconf.rb'] s.description = 'WiringPi library wrapper for the Raspberry Pi only. Wraps up the Arduino wiring-like WiringPi library into a convinient Ruby gem. Currently includes GPIO functionality, serial and shiftOut/shiftIn support. Credit to Gordon for the WiringPi library, which can be found here: http://projects.drogon.net/raspberry-pi/wiringpi/' From 1af1000a37e09947d1f490fcaa17c8c51b51f7dc Mon Sep 17 00:00:00 2001 From: Joe Haig Date: Fri, 15 Aug 2014 17:57:47 +0100 Subject: [PATCH 2/2] Bump version number and force empty lib/wiringpi --- lib/wiringpi/.keep | 0 wiringpi.gemspec | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 lib/wiringpi/.keep diff --git a/lib/wiringpi/.keep b/lib/wiringpi/.keep new file mode 100644 index 0000000..e69de29 diff --git a/wiringpi.gemspec b/wiringpi.gemspec index a31f6ed..55771fd 100644 --- a/wiringpi.gemspec +++ b/wiringpi.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'wiringpi' - s.version = '1.1.0' + s.version = '1.1.1' s.license = 'GNU General Public License' s.date = '2012-06-22' s.platform= Gem::Platform::RUBY