Thread: iLiad Ruby 1.8.5 for iLiad
View Single Post
Old 02-16-2009, 07:13 AM   #18
-Thomas-
Addict
-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.
 
-Thomas-'s Avatar
 
Posts: 325
Karma: 1725
Join Date: Dec 2007
Location: Münster, Germany
Device: iRex iLiad v2
Lightbulb

I've compiled libsqlite3-ruby1.8 for the iLiad. This allows you to talk to a sqlite3 database with Ruby.
  • Please install sqlite3 from this post
  • Next install the attached libruby1.8 ipkg. This is a temporary package and contains no data so far, but libsqlite3-ruby1.8 depends on it. In the future I will split up the Ruby package into the binary and the libraries, and this a little preparation to do so.
  • Now you may install the libsqlite3-ruby1.8 ipkg.
The library uses ~250k of space and will be installed wherever you have installed Ruby. Some test code from the interactive Ruby shell:
Code:
root@ereader:/var/tmp$ irb
irb(main):001:0> require "sqlite3"
=> true
irb(main):002:0> db = SQLite3::Database.new("/tmp/test.db")
=> #<SQLite3::Database:0x402e2bac @handle=#<SWIG::TYPE_p_sqlite3:0x402daf9c>, @translator=nil, @statement_factory=SQLite3::Statement, @type_translation=false, @results_as_hash=false, @driver=#<SQLite3::Driver::Native::Driver:0x402e2b0c @busy_handler={}, @authorizer={}, @callback_data={}, @trace={}>, @transaction_active=false, @closed=false>
irb(main):003:0> db.execute("SELECT * FROM test") do |row|
irb(main):004:1* puts row[1]
irb(main):005:1> end
abc
=> nil
Have fun!
Attached Files
File Type: ipk libruby1.8-1.8.5+iliad.r01.ipk (900 Bytes, 398 views)
File Type: ipk libsqlite3-ruby1.8-1.2.4+iliad.r01.ipk (47.3 KB, 409 views)
-Thomas- is offline   Reply With Quote