Facets 1.8

Facets 1.8

Facets is a large collection of core extension methods and module
additions for the Ruby programming language. The core extensions are
unique by virtue of their atomicity. Methods are stored in their own
files, allowing for highly granular control of requirements. The
modules include a variety of useful classes, mixins and
microframeworks, from the Functor to a complete SI Units system.

http://facets.rubyforge.org


It’s been a long time since the last release of Facets. Too long
really. 1.7’s tiny number made it all the way up to 191 before I
tagged it 1.8, plus 51 subsequent changes before official release! So
Facets continues to mature: new methods have been added, as well as a
few classes. And 2.0 promises to be even more exciting. As always
thanks to everyone who has contributed, both directly and indirectly.

Here’s a (fairly raw) summary of the ChangeLog.

  • significant improvements to command.rb thanks to Tyler Rick
  • added tests to elementwise and tap
  • fixed test for elementwise and op_tilde_self
  • added enumerable/map_send
  • added thread_map and thread_map_send thanks to greg
  • added operator “[email protected]” for enumerable/elementwise
  • added more/consoleutils.rb
  • added string/cleave
  • added capitalize_all thanks to Richard Laugesen
  • cartesian_product is an alias of enumerable/cart
  • added array pad thanks to Richard Laugesen
  • added kernel/tap
  • converted facet/ requires to facets/core or facets/more as needed
  • further improvements to arguments.rb (looking good!)
  • improved symbol/self/generate
  • bug fix kernel/autoreload arguments needed to be in opposite order
  • add to_xoxo
  • removed bad character codes in multiplier.rb
  • used yaml to allow json.rb to work for all objects in general
  • improvements to functor (note: is to_a and to_proc okay?)
  • add test to string/bytes.rb
  • bug fix to nilclass/op_cmp
  • fixed enumerable/op_pow to use enumerable/cart
  • added array/op_div
  • adjustments to xmlbuilder and htmlbuilder dur to buildingblock
    changes
  • improved buildingblock.rb
  • simplified interface of arguments.rb (still a little more to do)
  • improvements/simplifications to Dir.multiglob
  • fixed misspelling of behavior.rb (was bahvior.rb)
  • removed #own from base list in facets.rb (really need a standard
    for “singleton class”)
  • fixed bug in aspects.rb that would not handle args of wrapped
    method
  • Symbol#to_s optimization, had to remove freeze
  • updates to fileutils/stage (stage worth keeping?)
  • fix bug in kernel/ask, returns more than one character
  • cleanup of enumerbale/graph (no effective change)
  • new super fast enumerable/cart by Thomas H. (replaces #cross)
  • improved multiglob rountines (accept ‘+’ and ‘-’ prefixes)
  • fixed bug in attr_tester, thanks Dov!
  • added weekdays to times.rb thanks to Ryan P. and Dave Hoover
  • improvements to dictionary.rb (no longer a subclass of Hash)
    thanks Jan!
  • improvements to ann.rb and ann_attr.rb. works, yea!
  • fixed bug in string/singular.rb
  • changed enumerable/cross into enumerable/cart and
    cartesian_product
  • moved enumerable/cross to enumerable/cart (cartesian_product)
  • added buildingblock.rb, replaced builderobject.rb
  • adjust require for “yored” files
  • HtmlBuilder and XMLBuilder are now based on BuildingBlock
  • ostuct adjustment, use #instance_delegate to get underneth the
    open access
  • module/include_as is now based on module/namespace (thanks Pit!)
  • fixed enumerable/partition_by
  • further updates to project info file (need to stop versioning
    this)
  • deprecated (yored) builderobject.rb (poor implementation)
  • added hash/insert; like store but only if key isn’t already
    present
  • added module/include_and_extend
  • facets.rb now references facets/sys.rb
  • added facets/automatic – very cool, albiet expiremental way to
    load core methods automatically!
  • added module/module_method; like module_function but makes method
    public
  • added module/include_function_module; attempts to properly include
    one function_module into another
  • kernel/yaml convenience method for YAML::load
  • added kernel/supress; supress errors while executing a block (nice
    DHH!)
  • added symbol/chomp, like string#chomp
  • added proc/to_h; converts an assignment proc into a hash
  • proc/bind; bind a proc to an object, returning a method
  • added module/prepend; provides dyanamic method wraps for modules,
    and static wraps for classes
  • added module/new; use a module as if it were a class
  • added module/alias_accessor
  • renamed #superior to #super_at
  • kernel/instance_class; yet anouther meta_class name, but a more
    sensicle name this one
  • added kernel/populate; populates an object’s inst. vars from a
    hash or assingment block
  • added kernel/daemonize; yet another thanks to DHH!
  • added enumerable/injecting; like inject but automatically returns
    the memo from the block
  • added kernel/object_send, a true public-only send method
  • added kernel/silence_stream; output to null device; thanks DHH!
  • added kernel/instance_values, thanks DHH!
  • added Config::inspect for rbconfig
  • added hash/pairs_at (aking to values_at)
  • added _why’s metaid methods (meta_class, meta_eval, etc.)
  • added kernel/enable_warnings to complement silence_warinings
  • added integer/to_roman
  • added logical operators for hash (and/or)
  • array/to_path convert ans array to a path string
  • array/index takes a block
  • added fileutils/compress; very simple convenience methods for
    archiving folders
  • added fileutils/stage adn staged, a means of transfering files
    accoring to preset rules
  • had to remove taskable.rb for now (implementation won’t work as
    toplevel include)
  • added kernel/ask, simply command to get console input
  • moved deprecated #facet_require to yore lib
  • deprecated (yored) kernel/own, yet another term for the singleton
    class
  • renamed quaclass to qua_class
  • added populate.rb, mixin for classes that need on a basic
    initializer
  • added version_number.rb (a specialized tuple)
  • added uploadutils.rb
  • added Joel VanderWerf’s great script.rb script
  • added Austin’s minitar.rb --it’s just too damn useful! (not in
    rdocs though)
  • added htmlfilter.rb very nice html escape class
  • added dependency.rb, allows methods to have dependent execution
    (like rake tasks)
  • added arguments.rb this is for parsing console command arguments
  • add new version of annotations: ann.rb and ann_attr.rb
  • memoize should now work at toplevel
  • removed dataobject.rb (was never used)
  • doc change to methodfilter.rb (maybe deprecat in future)
  • deprecated (yored!) module/inject; what a silly method
  • added File::yaml? to roughly detect if a file is a yaml file
  • deprecated kernel/require_facet (no longer needed)
  • moved old module/namespace implementation to yore
  • moved plugin.rb to ratchets/library project
  • proper credit for multiton goes to Ara T. Howard!!! Also
    improvements.
  • remove library.rb (move to ratchets/library project)
  • improved time/stamp
  • reimplemented proc/to_method for more sensible behavior
  • reimplemented module/namespace, very clever thanks to pit captain
  • added module_load and module_require, e.g. load into and require
    into
  • reimplemented instance_exec, should be much improved
  • doc updates to inflect.rb
  • updates to Hash op_add, reverse_merge, and rekey
  • each_slice is now just an alias via enumerator & fixes to
    partition_by
  • modified all.rb (not recommended!) to require facets/sys
  • modifications to project information file (should this be
    versioned?)
  • created yore lib to store deprecated features (good idea!)
  • modified PROJECT info file
  • added module class/module_load and _require
  • remove facet/ redirect lib from darcs repository
  • kernel/returning is a stub for kernel/with
  • added proc/update as alias for #call per Tim P. use of Proc as
    Observable
  • added behavior.rb by Nobuyoshi N. (plan to improve)
  • rewrote taskable.rb using classes to represent tasks; it is much
    improved
  • openobject.rb doc updates
  • major update to functor which is now a subclass of Proc (should be
    faster)
  • improvements to dictionary.rb to go along with additions of first
    and last
  • small improvements to command.rb
  • removed uses of class for object_class and solidified usaged
    of #as in basicobject.rb
  • deprecated ostruct shadow methods (i.e table) in favor of
    #instance methods
  • added test to module/alias_method_chain
  • imporvements to instance_exec thanks to Mauricio F.
  • improvements to kernel/send_as
  • improvements to kernel/as
  • fixed syntax in hash/op_add.rb
  • imporvements to hash/partition_by thanks to Gregory of Laurel
  • added Mauricio F. to authors
  • added addtional work library lore
  • moved a number of “in the works” libs to ToadCode project
  • removed predicate.rb, an expiremental logic system, and moved to
    ToadCode
  • Added plugin.rb, an indirect require mechinism, ie. a plugin
    system
  • remove one.rb and moved to ToadCode project, this was just silly/
    fun library
  • Added library.rb which is a library ledger system (used to be
    roll.rb)
  • added kernel/with which instance_eval’s a block on with’s subject
  • rekey is an improved version of normalize_keys (ie. the basis of
    symbolize_keys)
  • multiglob is like glob but handles a list of patterns
  • proper access to openstruct’s underlying table
  • doc fixes and losening toplevel constraint to Object in taskable
  • made OpenObject #update and #merge public; added to_hash
  • removed unorder_store and store_only; added first/last to
    dictionary
  • continued improvements to command.rb
    added some new callbacks such as option_missing;
    also handles method_missing properly now
  • added string/rewrite
  • test fixes to module/include_as
  • documentation fix for class_extension
  • minor edit to supermethod (also finish #superior removal)
  • cleanup kernel/set_with code
  • update kernel/metaclass can now take a block
  • added hash#+ and hash#- (op_add and op_sub)
  • added cache to enumerable/every
  • removed kernel/superior (silly name)
  • add more/autovivify.rb expiremental lib.
  • update/fix to command.rb to not use Kernel methods as subcommands.
  • update Work on annotation.rb to improve support for :self.
  • deprecate enumerable/permute.rb (replaced by permutation) and
    minor test fix to linkedlist.rb
  • added linkedlist.rb (thanks Kirk H.!)
  • added enumerable/sum (thanks to Gavin K.)
  • added array/each_combo and combos (Eunumerable.combinations will
    be deprecated eventually)
  • rename changed enumerable/permute to permutation
  • update annotation.rb, fixed :self key
  • added pathname/op_div
  • deprecated hash/each.rb
  • removed hash/each.rb, this variation of Hash#each is too
    “dangerous” in practice
  • update module/self/op_add.rb: fixed inclusion order
  • deprecated annotation.rb, replaced with ann.rb
  • added module/self/op_add.rb and op_sub.rb - traits like features
  • minor improvemtns to module/clone_using and integrate
  • openobject.rb (added NilClass#to_openobject)
  • replaced enumerable/each_slice.rb w/ redirect to enumerator.rb.
    Ruby already has #each_slice if you require ‘enumerator’. For 1.9,
    I believe this will be present automatically. So Facets’
    each_slice
    has been replaced with a simple redirection to require
    ‘enumerator’.
    Ruby’s version is slightly different in that it won’t check arity
    if
    a slice count is not given. For this, use enumerable/each_by.
  • removed array/delete_at.rb (Use #delete_values_at instead)
  • moved File.bitbucket to File.null (but bitbucket was so “fun”! :wink:
  • added nilclass/to_path
  • added kernel/load_local
  • added kernel/callee
  • added enumerable/eachn, integer/each and integer/of
  • re-added array/delete_values_at
  • added filetest/self/root
  • added cache.rb
  • moved Dir.bitbucket to File.bitbucket
  • removed task file in favor of sake based util/
  • added main_as_module
  • added doublemetaphone thanks to Lawrence Philps.
  • added symbol/to_s which caches the result for speed up
  • additions and adjusments related to hash/delete_at
  • added Dir.bitbucket
  • update to array/op_fetch to include op_store
  • added filesystem.rb
  • updates to enumerable each_slice
  • updated names of meta files
  • added trace to command.rb

ALL YOUR BASE ARE BELONG TO RUBY!

Trans wrote:

  • added array pad thanks to Richard Laugesen
  • bug fix to nilclass/op_cmp
  • fixed bug in aspects.rb that would not handle args of wrapped
    thanks Jan!
  • module/include_as is now based on module/namespace (thanks Pit!)
  • added module/module_method; like module_function but makes method
    and static wraps for classes
  • added kernel/object_send, a true public-only send method
  • added fileutils/compress; very simple convenience methods for
  • added populate.rb, mixin for classes that need on a basic
  • add new version of annotations: ann.rb and ann_attr.rb
  • remove library.rb (move to ratchets/library project)
  • modified all.rb (not recommended!) to require facets/sys
  • rewrote taskable.rb using classes to represent tasks; it is much
    #instance methods
    ToadCode
  • proper access to openstruct’s underlying table
  • minor edit to supermethod (also finish #superior removal)
  • added linkedlist.rb (thanks Kirk H.!)
  • deprecated annotation.rb, replaced with ann.rb
    if
  • moved Dir.bitbucket to File.bitbucket
  • added trace to command.rb

ALL YOUR BASE ARE BELONG TO RUBY!

Trans - just tried to install facets via gem and am getting the
following error:

(root) 2-> gem install facets
ERROR: While executing gem … (NoMethodError)
undefined method `refresh’ for #Hash:0xb7cbe49c

Installing it from the tar ball works fine. My gems seems to be in
working order as I just install another gem and upgraded my rails to
1.2. Just thought I’d mention this in case these a problem no one’s
run into as yet. (FYI, running ruby 1.8.5 p2.)

Thanks for Facets!

Ken

On 2/20/07, [email protected] [email protected] wrote:

(root) 2-> gem install facets
ERROR: While executing gem … (NoMethodError)
undefined method `refresh’ for #Hash:0xb7cbe49c

Your gem source_cache may be corrupt. There is a known issue, but the
cause is not yet understood.

-austin

On 2/20/07, Trans [email protected] wrote:

Would it have anything to do with this?

Haven’t a clue. I haven’t seen those; you may want to forward that to
the RubyGems development list to see if they have anything to say
about it.

I take it the current cure is to delete the source_cache?

That’s my understanding.

To be clear: this is not a Facets bug; it is a RubyGems bug. The
RubyGems developers know about it, but haven’t yet been able to
reproduce it in order to isolate it. Any assistance that people can
provide in reproducing it is appreciated.

-austin

On Feb 20, 5:12 pm, “Austin Z.” [email protected] wrote:


Austin Z. * [email protected] *http://www.halostatue.ca/
* [email protected] *http://www.halostatue.ca/feed/
* [email protected]

Would it have anything to do with this?

hook /usr/lib/ruby/gems/1.8/gems/rubygems-update-0.9.2/./post-
install.rb failed:
undefined method `post_install_message’ for #<Gem::Specification:
0xb7ae957c>
Try ‘ruby setup.rb --help’ for detailed usage.

I take it the current cure is to delete the source_cache?

T.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs