[LRUG] another beginner.. ruby but not rails
Eleanor
eleanor at goth-chic.org
Sat May 5 04:43:19 PDT 2007
On 4 May 2007, at 15:29, graham wrote:
> Hmm... as a beginner I would rather not be contemplating working my
> way
> through lines like:
>
> def R
> c,*args;p=/\(.+?\)/;args.inject(c.urls.detect{|x|x.scan
> (p).size==args.size}.dup){|str,a|str.gsub(p,(a.method
> (a.class.primary_key
> )[]rescue a).to_s)};end;def / p;File.join(@root,p) end;end;
>
> while debugging my tiny application. It's bad enough trying to
> debug my
> own code, but at least I can comment that..
Camping is very easy to use but the code is definitely guru-only
level in places. Don't even go near it unless you've ingested Why's
Poignant Guide (a quick google will give you the URL) or have a
strong background in Lisp and meta-programming otherwise you'll be
completely out of your depth.
When I first started doing HTTP-stuff in Ruby I found WEBrick a great
starting-point. Eric Hodel has written some pages describing the
rudiments of using it and a couple of weeks of hacking around with
the possibilities are likely to teach you most of Ruby's quirks. Yet
again though the actual source code is not particularly friendly,
something you'll find is common with a lot of the significant
libraries. I don't think it's that developers are trying to keep
their work obscure, just that once you grok Ruby it's damn hard to
think of meaningful comments to adorn it with!
Ellie
Eleanor McHugh
Games With Brains
----
raise ArgumentError unless @reality.responds_to? :reason
More information about the Chat
mailing list