From 278a2ea3f3d155c9190d4d6003d78fe727e8d967 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Wed, 7 Apr 2010 00:14:20 +0200 Subject: [PATCH 1/6] README.md: MPD-example added --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 2b929f7..5eaf769 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,18 @@ Usage if event.name == "play" system "xmms", "/av/music/3.mod" end + +Control your MPD: + + require 'lirc' + lirc = LIRC::Client.new + lirc.each do |event| + case event.name + when "play" + system "mpc", "play" + when "pause" + system "mpc", "pause" + when "stop" + system "mpc", "stop" + end + end From 377ef0006399545f7013857c02f526cf50704ec8 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Sun, 11 Apr 2010 18:22:37 +0200 Subject: [PATCH 2/6] meta-data changed (homepage) --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 716a628..2d5f569 100644 --- a/Rakefile +++ b/Rakefile @@ -8,7 +8,7 @@ begin gem.summary = %Q{LIRC client for Ruby} gem.description = %Q{} gem.email = "Denis.Knauf@gmail.com" - gem.homepage = "http://github.com/DenisKnauf/logan" + gem.homepage = "http://github.com/DenisKnauf/lircr" gem.authors = ["Denis Knauf", "Hans Fugal"] gem.files = %w[AUTHORS README.md VERSION lib/**/*.rb test/**/*.rb] gem.require_paths = %w[test lib] From 032b3dc04de6e0215f90d1805af8fb9fc4b9d028 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Sun, 11 Apr 2010 18:31:00 +0200 Subject: [PATCH 3/6] mpd-example changed. uses librmpd --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5eaf769..777adc8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ Description =========== -lircr (pronounced 'lurker') is a LIRC client library for Ruby. It's simple, -it's easy, it's fun. If you got LIRC, get lircr. I am not responsible if you +lircr (pronounced 'lurker') is a LIRC client library for Ruby. It is simple, +it is easy, it is fun. If you got LIRC, get lircr. I am not responsible if you grow more hair on your index finger or thumb. Usage @@ -19,14 +19,16 @@ Usage Control your MPD: require 'lirc' + require 'librmpd' lirc = LIRC::Client.new + mpd = MPD.new 'localhost', 6600 lirc.each do |event| case event.name when "play" - system "mpc", "play" + mpc.play when "pause" - system "mpc", "pause" + mpd.pause = !mpd.pause when "stop" - system "mpc", "stop" + mpd.stop end end From 2d4d4a870edd35deeb0bc88efc866883e851a443 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Sun, 11 Apr 2010 18:48:10 +0200 Subject: [PATCH 4/6] typo fixed --- lib/lirc.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lirc.rb b/lib/lirc.rb index d17dd24..a2fe693 100644 --- a/lib/lirc.rb +++ b/lib/lirc.rb @@ -2,9 +2,9 @@ require 'socket' module LIRC class Client - def initializer dev = nil + def initialize dev = nil dev ||= "/dev/lircd" - @sock = UNIXSocket.open dev + @sock = UNIXSocket.new dev end def next From d1855288894caba403cfcd3b484633dc199a9aa6 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Sun, 11 Apr 2010 18:48:38 +0200 Subject: [PATCH 5/6] VERSION 0.0.3 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4e379d2..bcab45a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.2 +0.0.3 From 8e2368bf95c7f426978201c75098f4b90c5490bb Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Sun, 11 Apr 2010 18:54:04 +0200 Subject: [PATCH 6/6] example: mpd.connect. readline -> gets --- README.md | 1 + lib/lirc.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 777adc8..10b21a7 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Control your MPD: require 'librmpd' lirc = LIRC::Client.new mpd = MPD.new 'localhost', 6600 + mpd.connect lirc.each do |event| case event.name when "play" diff --git a/lib/lirc.rb b/lib/lirc.rb index a2fe693..055b305 100644 --- a/lib/lirc.rb +++ b/lib/lirc.rb @@ -8,7 +8,7 @@ module LIRC end def next - Event.new @sock.readline + Event.new @sock.gets end def each_event