Its Me
4/12/2005 5:19:00 PM
I was just playing with the recent "command" utility. It has a single class.
class PhoneBook < Cmd ..... end
When I install this as a gem, and execute a breakpoint to inspect the
current PhoneBook in irb, and look at "self", I get all kinds of stuff that
is has not been declared anywhere in PhoneBook, as far as I can tell.
> self.class
#=> PhoneBook
> self
#=>
.... all kinds of stuff about gems as part of "self", many pages long.
@rubyforge_project=nil,
@rubygems_version="0.8.10",
@specification_version=1,
@summary=
"This package provides download sources for remote gem installation",
@test_files=[],
@version=#<Gem::Version:0x2b286a0 @version="0.0.1">>,
#<Gem::Specification:0x2b26828
@authors=["Jamis Buck"],
@autorequire="sqlite3",
@bindir="bin",
@date=#<Date: 4906833/2,0,2299161>,
@default_executable=nil,
@dependencies=[],
@email="jgb3@email.byu.edu",
@executables=[],
@extensions=[],
@extra_rdoc_files=["README"],
@files=
["doc/faq",
"doc/faq/faq.html",
"doc/faq/faq.yml",
"doc/faq/faq.rb",
"ext/sqlite3_api",
"ext/sqlite3_api/post-clean.rb",
"ext/sqlite3_api/extconf.rb",
"ext/sqlite3_api/sqlite3_api.i",
"ext/sqlite3_api/post-distclean.rb",
"ext/sqlite3_api/MANIFEST",
"lib/sqlite3.rb",
"lib/sqlite3_api.so",
"lib/sqlite3",
"lib/sqlite3/statement.rb",
"lib/sqlite3/database.rb",
"lib/sqlite3/driver",
"lib/sqlite3/constants.rb",
"lib/sqlite3/translator.rb",
"lib/sqlite3/resultset.rb",
"lib/sqlite3/value.rb",
"lib/sqlite3/version.rb",
"lib/sqlite3/pragmas.rb",
"lib/sqlite3/errors.rb",
"lib/sqlite3/driver/dl",
"lib/sqlite3/driver/native",
"lib/sqlite3/driver/dl/driver.rb",
"lib/sqlite3/driver/dl/api.rb",
"lib/sqlite3/driver/native/driver.rb",
"test/bm.rb",
"test/mocks.rb",
"test/tests.rb",
"test/tc_integration.rb",
"test/tc_errors.rb",
"test/driver",
"test/native-vs-dl.rb",
"test/tc_database.rb",
"test/driver/dl",
"test/driver/dl/tc_driver.rb",
"README"],
@has_rdoc=true,
I am guessing this is gems-related. But of course I could be doing something
really very dumb. Could someone shed some light? Is it from breakpoint/irb?
Also, what method does irb call to display an object? I tried defining to_s
and inspect on PHoneBook but it had no effect.
Thanks.