Logan Capaldo
1/14/2006 11:12:00 PM
On Jan 14, 2006, at 5:49 PM, Simon Kröger wrote:
> > [...]
>> especially with heredocs and such. I would take a look at rdoc
>> and see if you can't manipulate it to get a list of classes for you.
>
> Maybe this is about regexps and i'm totaly off, but what about:
>
> ---------------------------------------------
> before = Object.constants
> require 'sqlite3' # put your file here
> after = Object.constants
>
> p(after - before)
> ---------------------------------------------
>
> output:
>
> ["NKF", "Deprecated", "SQLite3", "Base64", "Kconv", "ParseDate"]
>
>
> cheers
>
> Simon
>
Clever!
before = Object.constants
require 'file'
after = Object.constants
files_classes = (after - before).select { |x| Class ===
Object.const_get(x) }