On 2/9/07, Pedro Côrte-Real <[EMAIL PROTECTED]> wrote:
I wanted to use owfs in a Ruby project so I decided to port the Python ownet client to Ruby.
Attached is a more or less straight port of the Python version of ownet. I don't know if someone wants to check this first before I put it into CVS. I have a few things I'd like to do better: Smaller stuff: - Implement persistent connections - Abstract the messages into a class of their own so that instead of pack/unpack we can do "msg.flags = whatever". Should make the code prettier and probably simpler. Bigger stuff: - Unit test this. I was going to write a mock owserver replacement to use for testing but then I saw that owserver supports a fake backend that gives random values. The problem with this is that if I do someSensor.templow = 25 and then read someSensor.templow I don't get 25 back. I don't know if this is easy to fix. Any suggestions? - Rework the Sensor class API to handle paths better. It's called Sensor but it's really for any place in the OW paths. It would probably make more sense for it to be called something else and have an is_sensor? method to test if it's an actual OW sensor (will checking if there's a type attribute be enough for this?). The entries and each_entry method should then return OW objects instead of strings. Need to think about this better. Cheers, Pedro.
connection.rb
Description: application/ruby
ownet.rb
Description: application/ruby
sensor.rb
Description: application/ruby
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers