DB2 interface for Ruby progress
I’ve made progress porting the PHP ibm_db2 extension to Ruby. If you pick up the latest code and run it, you should now see
102 tests, 107 assertions, 0 failures, 0 errors
Some of the differences between Ruby and PHP (other than syntax):
- array and hash are separate types in Ruby, they are combined in PHP.
- some PHP functions, like
strlenandstrtoupperare methods in Ruby. - more automatic coercion in PHP: for example, string concat converts both arguments to string. String interpolation works fine in Ruby.
falseprints as a null string in PHP, and asfalsein Ruby.falsecan’t be printf’ed using a%dformat string in Ruby.- in PHP error messages go to the output. In Ruby, typically exceptions are thrown.
Interesting things found during testing:
- Ruby’s ALLOC doesn’t zero the storage. This means that something that passes when run individually may fail when run as a part of a suite.
- Ruby does garbage collection instead of reference
counting. This means that connections may not be immediately
closed, which can lead to deadlock. For now, I have defined a
teardownmethod that callsGC::start - And my personal favorite: in Ruby,
exitmeans exit. Not only is the test case exited, but also the test suite, and even the entire rake process.
Are you boiling frogs again?
It just makes sense (to me at least) to get something approximating the existing PHP tests to pass prior to making improvements.
Posted by Sam Ruby atIBM DB2
where’s the DB2 driver? is someone remove that? ===== This is what I found. db2_adapter.rb has required files: active_record/connection_adapters/abstract_adapter db2/db2cli active_record/vendor/db2 If you look into...Excerpt from Ruby on Rails at
IBM DB2
where’s the DB2 driver? is someone remove that? ===== This is what I found. db2_adapter.rb has required files: active_record/connection_adapters/abstract_adapter db2/db2cli active_record/vendor/db2 If you look into...Excerpt from Ruby on Rails at
Sam Ruby: DB2 interface for Ruby progress
as if more proof were needed that Sam’s a very sharp guy...Excerpt from del.icio.us/sogrady/ibm at
DB2 interface for Ruby Milestone
I’ve completed my first pass at porting the PHP ibm_db2 extension to Ruby. If anyone out there has both Ruby and DB2 installed on a Unix machine, I would appreciate hearing if you can reproduce my results. If you pick up the latest code and run... [more]Trackback from Sam Ruby at
The Philosopher’s Song
I’m not a programming language designer, but I know what love is....Excerpt from lesscode.org at
Now I got..
(in /tmp/rubydb2) /usr/bin/ruby18 tests.rb Loaded suite tests Started ...................................................................................................................... Finished in 28.009496 seconds. 118 tests, 124 assertions, 0 failures, 0 errors
Thank you.
Posted by Anbu atEclips-ing Ruby
Ruby Development Tools Originally uploaded by sogrady. A little over six months ago, I took a few minutes to consider the future of Ruby within mainstream enterprises. Despite my conclusion there - that Ruby deserved the accolades it was...... [more]Trackback from tecosystems at
Are you boiling frogs again?
Posted by Robert Sayre at