The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
To Hell With Oranges

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Trans Onoma

Posts: 63
Nickname: transfire
Registered: Aug, 2005

Trans Onoma has programming for too long.
To Hell With Oranges Posted: Mar 28, 2006 2:12 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Trans Onoma.
Original Post: To Hell With Oranges
Feed Title: TRANSONOMA
Feed URL: http://feeds.feedburner.com/transonoma
Feed Description: A Light Green Agile Programming and SciTech Blog
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Trans Onoma
Latest Posts From TRANSONOMA

Advertisement
As some of you already know. I did a complete one-eighty on my last post. I was resigned to the fact that I would have to maintain two projects --the extension methods were just not meshing well with the additions modules. But then someone starts talking some smack about Facets on ruby-talk, and I'm like, "Damn it I'm going to make it work!" And so I did! :)

I took a two-prong approach. First, I went with my previous setup. I kept the libs separate under lib/facets/core and lib/facets/more, and created redirection files under lib/facet/ which tie back to both of these. 'facet/' is the require location that should generally be used. Don't use facets/core/ and facets/more/ directly. That way the facets/ directory (notice the plural) will remain independent of end-user requires and can be reorganized if need be without causing any backward incompatabilities. This works well, albeit it does create an additional level of indirection. (It's just too bad Windows doesn't support symlinks --those would be even better.)

The second tactic is in facets.rb itself. While this is an optional file, by requiring it you not only get a dozen or so common core extenions automatically, it also adds Facet's core/ and more/ lib paths to Ruby's lookup path. That way the initial 'facet/' prefix isn't even needed. Eg.

require 'facets'
require 'functor'

It adds lib paths to the end of the lookup path so they won't interfer with any other library. If there is a name conflict you can always use the prefix to get at the facet.

You check out the new web site http://facets.rubyforge.org.

Read: To Hell With Oranges

Topic: The module no one wants to rewrite Previous Topic   Next Topic Topic: The next computing paradigm?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use