I come from LEAF user community.
I'm a damn stupid newbie about RUBY.
I just impresed by someone who post about how easy to write a JABBER client
using ruby.
Since I come from a community of users of Small linux distro, my concern is
about a micro Ruby "distro" (maybe like Micro Perl)
So Here is my question :
1. Is there anyone can give me a list of extremely minimal files that have
to be compiled to got ruby core interreter work properly ?
You have to compile the whole thing. If you wish, you can disable the
building of the C native extensions (such as socket, zlib etc) - but they
all are built as separate .so loadable modules, so you might as well just
build them and then not copy them onto the target system if you don't want
them.
2. What is the minimal libs have to be loaded/compiled to write :
++ Jabber client
++ BASH similar : Cat, Cut, sed
Your Jabber client will need at least socket, and probably an XML parser
like REXML. There may be a higher-level Jabber library which you can use.
Bash-like functionality probably doesn't need any libraries, although you
might want readline.
I'm intended to compile of that minimal files with uCLib .. and may be
create a "*.lrp" package for the LEAF community.
In case it's of interest, there's a ruby-1.8.6 package for OpenWrt
http://www.openwrt.org/
https://dev.openwrt.org/browser/packages/lang/ruby
I made a squashfs filesystem containing for a complete OpenWrt installation
with all the usual bits (kernel, uclibc etc) plus ruby with an almost
complete(*) set of ruby libraries, and the whole lot takes 2.8MB. So it fits
quite nicely in a device with 4MB flash.
It might be possible to slice'n'dice the ruby standard libraries so that
parts can be omitted, but deciding how to put them into coherent bundles may
be hard, and other people would probably disagree with your choices. For
example, you could argue that all XML and YAML plus everything that depends
on them (e.g. SOAP, XMLRPC) should go in a library bundle. But that wouldn't
be much use to you, as your Jabber client would probably want at least
REXML, in which case you'll end up loading everything else.
If memory really is that tight, I'd say it's probably easier to work the
other way round: start with just ruby and *no* libraries. Give your
application a lib/ directory and manually install in there all the libraries
that you find you need to make it work.
Regards,
Brian.
(*) Actually, rdoc, test::unit and nkf are in separate packages and I left
these out. But it includes all the rest of the .rb libraries, plus C
extensions such as socket and yaml, and irb.