A N N O U N C I N G
Ruby Facets, v 2005-10-30
The Proverbial Zoo-of-More for Ruby
ABSTRACT: Ruby Facets is a cornicopia of extension methods and
module/class
additions for the Ruby programming language. The extensions, known as
the
the Atomic Library, is unique by virtue of thier atomicity. Methods are
stored in their own files, allowing for highly granular control of
requirements. In addition Facets includes a large selection of useful
classes, modules and microframeworks (once known as Calibre Classes).
For More Information
http://facets.rubyforge.org
ALL YOUR BASE ARE BELONG TO RUBY!
------------------------------------------------------------------------
(from ANN)
I'm pleased to finally announce the next major release of Facets
--the Halloween release (2005-10-30). Baring any signifficant
issues arising in Novemeber, this release will be stamped "Stable"
on the first of December.
If you'll recall, our last release was a brief flirt with new names
Nano Methods and Mega Modules. With this release we've decided to
go back to the original name Facets, having deemed it in the interm
to be the better course, and to which it will *stay for good*.
Namespace compatability is being maintained with this release, so
all the following will work as expected:
require 'facet/...'
require 'nano/...'
require 'mega/...'
This release also begins a transition to a more robust require
mechanism. You should require the main facitlity before utilizing
the rest of Facets with:
require 'facets'
This loads all base methods (about a two dozen very basic methods)
and the Facets module. Then, where you would have used the
Kernel#require method like so:
require 'facet/time/stamp' # to be deprecated
You should instead begin transitioning to:
Time.use Facets, :stamp
Using this method allows Facets to work more perceisely and
efficiently.
For instance one of the clear advantages of this method is that Facets
can search the class hierarchy for a method. For example if you wanted
to use #each_permutation on an Array.
Array.use Facets, :each_permutation
And even though #each_permutation is an Enumerable method this will
still work. It also allows for the use operators without special
recourse. For instance, the Proc composition operator can be required
simply:
Proc.use Facets, :*
The reason the Facets module is specified is because #use is a general
method. Anyone can easily take advantage of this functionality by
utilizing Facets Module Code Package system (package.rb). See the API
Documentation for further details of putting this to use in your
programs.
All in all, there's plently of new stuff in here and a good bit of code
clean-up. Some of the most notable additions include:
* annotation.rb - An advance annotations system George Moschovitis
and I developed.
* units.rb - An extensive SI Units system by Peter Vanbreokhoven.
* class_inherit - THE way to have modules include class methods when
inherited. This takes the next step beyond ClassMethods.
* inheritor.rb - A neat and useful way to inherit data through the
class heirarchy.
For the rest please see the Website, CHANGELOG and the API Docs.
*** Extra special thanks to Peter and George! ***
Thanks,
trans.
------------------------------------------------------------------------
Generated by REAP, the Ruby Project Assistant.
(http://www.ruby-lang.org) Do you Ruby?
first, let me say I find your work on facets/carats/nano/mega useful and
I thank you for this, but may I suggest a little more thinking is put on
radical changes like requiring logic and names?
AFAIR in most new releases there was a major change (naming scheme for
methods, require logic, module names etc).
I'm not trying to say you did not put reasoning behind this, but
somewhat I got the feeling that the whole thing seems fragile and non
dependable (is this a word?).
Try _too much_ thinking, not too little. Beleive me this hasn't been
easy for me and there are some circumstances regarding the name issue
that I'm won't go into b/c its long and boring. But the needless to
say, the naming issue is done.
> AFAIR in most new releases there was a major change (naming scheme for
> methods, require logic, module names etc).
For the last two release that's true. But Facets is beta on the whole.
It's getting more stable but it will still take a release or two before
to starts to really settle down.
> I'm not trying to say you did not put reasoning behind this, but
> somewhat I got the feeling that the whole thing seems fragile and non
> dependable (is this a word?).
I think that's overstating a bit. Facet's is simply going through an
important transition. (The naming issue aside which was unfortunate but
incidental) This is really a transition to something _more dependable_.
Why? Think about this new way to call on methods
String.use Facets, :capitalized?
Notice there is no mention of any location in the file system. Consider
also the punctiuation mark being used and the fact that this can search
the class hierarcy for the method. This all adds up to a more robust,
more reliable system.
So yes, its a change and a transition. A different way of doing things.
But there is a great deal of benefit to gain from it. I'm trying to
make the transistion as gentle as possible.
T.
> AFAIR in most new releases there was a major change (naming scheme for
> methods, require logic, module names etc).
>
> I'm not trying to say you did not put reasoning behind this, but
> somewhat I got the feeling that the whole thing seems fragile and non
> dependable (is this a word?).
These are reasons why, despite there being some things in Facets that are
quite similar to some code that I use, and despite me having some code that
might make sense as part of Facets, I have been very reluctant to use it or
contribute anything to it. It seems like I'd be creating a lot more work for
myself to do so, right now. I may well be wrong about that, but that's the
impression that I have.
Kirk Haines
While I understand, I think maybe the concern is a bit over drawn. Yes,
there some transition going on right now with how requiring is done.
And in genreal Facets is still young so some things are still getting
settled. Using a young piece of software (especially one as vast as
Facets) means keeping pace with a more rapid growth until the software
matures. That's too be expected.
But if your just starting to use Facets, you have much less to worry
about --there will be one more significant transition with the next
release which will add built in versioning. But even then that won't be
as significant a change as this realease. And from there it's all
downhill, only getting more and more stable as time goes on.
T.
> Time.use Facets, :stamp
I would prefer this to be
Time.use :facets, :stamp
or
Time.use_facet : stamp
I also prefer the current form:
require 'facets/time/stamp'
regards,
George.
--
http://www.gmosx.com
http://www.navel.gr
http://www.nitrohq.com
It is not right to "take-over" usage of #use just for Facets. This is a
method analogous to 'use' in Perl and I have generalize it's
applicaiton for everyone to use, working very much like
append_features:
class Module
def package( name, &block )
@__package__ ||= {}
return @__package__ unless block_given?
@__package__[name.to_sym] = block
end
def provide_features( base, *selection )
selection.each do |s|
base.class_eval( &@__package__[s.to_sym] )
end
end
def use( package, *selection )
package.provide_features( self, *selection )
end
end
> or
> Time.use_facet : stamp
This is hardly any differnt, but it is too particular. The new solution
is something that can be commonly used theu is can become as
recognizable as #require itself.
> I also prefer the current form:
>
> require 'facets/time/stamp'
Me too --becuase we're accustom to it. But a new way is needed to
handle more advance fetures and it's not a good idea to hack require to
do this.
T.
This is not taking over, just providing a mapping from the symbol
:facets to the class Facets for anyone who would prefer the look of the
former.
martin
Ah, my bad. I glazed right over the fact that the first symbol was
:facets. I see your point. Unfortunately using lowercase causes an
assumpition on how to convert the symbol to the moudle name. But I can
add
Time.use :Facets, :stamp
if that's helpful.
T.
I've added. It will be in final 05-12 release.
T.