[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby LED Sign Service

Aaron Patterson

9/29/2006 5:55:00 AM

I just released a new version of my BetaBrite sign library, and I
decided it would be neat if I had a service so that people could try out
the library.

I've created a DRb service that lets you write to my BetaBrite LED sign
and take a photo of it. The service has 3 methods, "write_simple" which
just takes a string and writes it to the sign, "write" which takes a
BetaBrite::String and writes it, and "take_photo" that returns a photo
of the sign. Both methods that write to the sign will also return a
photo of the sign.

Here's a simple example:

require 'drb'
require 'rubygems'
require 'betabrite'

DRb.start_service()
obj = DRbObject.new(nil, 'druby://eviladmins.org:9000')

File.open("out.jpg", 'wb') { |a|
a.write obj.write_simple("Seattle.rb")
}

There are, of course, a few caveats... First, if the message you create
is too long, it will scroll. I have a crappy webcam, so scrolling
messages won't look very good. I haven't done much error checking in
the server, so please be nice. I could shut this thing down at any
time, I don't guarantee that my server is up, and as always YMMV, etc.

For a slightly more complicated example and a sample photo, check out my blog
entry:
http://tenderlovem...2006/09/28/new-ruby-beta...

Hope everyone likes it!

--
Aaron Patterson
http://tenderlovem...

3 Answers

Pawel Szymczykowski

9/29/2006 6:39:00 AM

0

On 9/28/06, Aaron Patterson <aaron_patterson@speakeasy.net> wrote:
> I just released a new version of my BetaBrite sign library, and I
> decided it would be neat if I had a service so that people could try out
> the library.

That is one of the niftiest things ever! I wonder if it will work from
tryruby too.

Good job on that - I've always wanted to get one of those led signs to
scroll rss feeds / server uptimes etc. Now it seems like it would be
super easy to do. :)

-Pawel

Dr Nic

9/29/2006 6:49:00 AM

0


> File.open("out.jpg", 'wb') { |a|
> a.write obj.write_simple("Dr Nic")
> }

Damn my corporate firewall. I want my own "DR NIC" sign! I shall try
from home tonight!


--
Posted via http://www.ruby-....

Bil Kleb

9/29/2006 10:53:00 AM

0

Dr Nic wrote:
>
> Damn my corporate firewall. I want my own "DR NIC" sign! I shall try
> from home tonight!

Ditto:

Errno::ECONNREFUSED: Connection refused - connect(2)> (DRb::DRbConnError)

--
Bil Kleb
http://fun3d.lar...