Ruby Facets v2.9.0 Release Notes

Release Date: 2010-09-01 // almost 12 years ago
  • ๐Ÿš€ This release is fairly extensive as it was originally intended to be v3.0. After further consideration it was decided to reserve v3.0 for the ๐Ÿ’… polish of real world feedback and more progressive changes. The primary ๐Ÿš€ focus of this release has been the completion of migrating Facets into a true ๐Ÿš€ extensions library. With this release almost all add-on classes and mixins have now been spun-off to other projects. Only the most general purposes โž• add-on classes and mixins remain.

    A new TOUR library division has also been added to complement CORE and MORE. This division houses purely optional extensions. The new division serves a couple of useful purposes. In particular, it helps separates the standard library extensions from optional core extension in the RDocs and thus makes the perfect place to vet new extension ideas.

    One important change that will effect anyone using Facets along side ๐Ÿ‘ ActiveSupport is that Facets no longer tries to conditionally avoid ๐Ÿ‘ method overlaps with ActiveSupport. This is fine for the upcoming ๐Ÿ‘ ActiveSupport 3.0 library which extends core classes directly instead of ๐Ÿš… using mixins. One need only require 'facets' in the Rails config/preinitializer.rb ๐Ÿ‘ file and ActiveSupport will take precedence over Facets. For older versions ๐Ÿ‘ of ActiveSupport, the best approach is to cherry pick from Facets just the extensions you want, thus avoiding any conflicts. There are actually only a dozen or so overlaps and all are intended to compatible, but it doesn't hurt to be sure.

    ๐Ÿš€ Lastly, it is worth mentioning that this release has been more thuroughly ๐Ÿš€ tested than any version of Facets to date. Thanks to RVM this release runs ๐Ÿ’Ž green on Ruby 1.8.6, 1.8.7 and 1.9.2.

    ๐Ÿ”„ Changes:

    • ๐Ÿ†• New Features

      • Add Kernel#temporarily, set variables temporarily and eval block
      • Add Kernel#deep_clone, a better alternative to #deep_copy
      • Add Kernel#present? and Kernel#presence
      • Add Kernel#not and #not?
      • Add Array#extract_options!, for pulling options off argument list
      • Add Regexp#|, operator for Regexp#union
      • Add Array#percentile and Array#median
      • Add Module#memo, for instance level memoization
      • Add YAML.read method
      • Add Pathname#include?
      • Add Module#anonymous?
      • Add Module#copy_inheritor
      • Add Indexable#from and Indexable#upto
      • Add Array#from and Array#thru
      • Add NA class via na.rb
      • Add Memoizable in memoizable.rb for a more robust memoization system
      • Add Module#safe_memo in thread.rb for thread safe memoization
      • Add Kernel#sandbox in thread.rb for threaded $SAFE=4 evaluation
      • Add Hash#subset
      • Add Kernel#Y to tour library
      • Add numerous Math extensions
    • ๐Ÿ—„ Deprecations

      • Deprecate Module#attr_toggler as a YAGNI
      • Deprecate Kernel#class_eval b/c of it's confusing behavior
      • Deprecate Module#once is no longer an alias for #memoize
      • Deprecate Integer#succ(n) (for compatibility reasons)
      • Deprecate Stackable, it's method were moved to CORE
      • Deprecate Kernel#populate and #set_from (use #assign and #assign_from)
      • Deprecate Kernel#non_nil? since #not_nil? is enough
      • Deprecate #HERE b/c implementation was unreliable
      • Deprecate Time#since, use #less instead
      • Deprecate Time#advance, use #shift instead
      • Deprecate Kernel#super_as (no good way to get callers method name)
      • Deprecate Integer#clear_bit, use #bit_clear instead
      • Deprecate Kernel#resc, use String#to_re or #to_rx instead
      • Deprecate Module#modspace
      • Deprecate Kernel#__ and class X for Proc#partial, use NA instead
      • Deprecate autoreload.rb has been spun-off to a separate project
      • Deprecate Module#nesting, b/c redundant and overlap with Module.nesting
    • ๐Ÿ“‡ Renamed Features

      • Rename Module#parent to Module#enclosure
      • Rename Module#parents to Module#enclosures
      • Rename Module#parent_name to Module#modname
      • Rename Array#recurisvely to Array#recurse
      • Rename Hash#recurisvely to Hash#recurse
      • Rename Enumerable#recursive to Enumerable#recursively
      • Rename Array#recursive to Array#recursively
      • Rename Hash#recursive to Hash#recursively
      • Rename Kernel#silence_warnings to Kernel#disable_warnings
      • Rename Hash#recursive_merge to Hash#deep_merge
      • Rename Class#prepend to Class#preallocate
      • Rename File#atomic_write to FileUtils#atomic_write
      • Rename Module#conflict to Module#method_clash
      • Rename Class#inheritor to Module#class_inheritor
      • Rename Symbol#re_s to Symbol#as_s
      • Rename String#chars to String#characters
      • Rename String#outdent to String#unindent
      • Rename Time#round to Time#round_to
      • Rename Time#hence to Time#shift (but keep aliases)
      • Rename Hash#zipnew to Hash#zip
    • ๐Ÿšš Moved Libraries

      • Move roman.rb to integer/roman and string/roman.rb
      • Move blank.rb to kernel/blank.rb
      • Move facets-live.rb to facets/auto_core.rb
      • Move cattr.rb to MORE library
      • Move duplicable.rb to kernel/dup.rb
      • Move bitmask.rb to integer/bitmask.rb
      • Move enumerable/divide.rb to array/divide.rb
      • Move enumerable/split.rb to array/split.rb
      • Move enumerable/entropy.rb to array/entropy.rb
      • Move enumerable/probability.rb to array/probability.rb
      • Move enumerable/duplicates.rb array/duplicates.rb
      • Move module/enclosure.rb to optional TOUR libs
      • Move kernel/instance_exec to option TOUR libs
    • ๐Ÿ› Bug Fixes

      • Fix Fixed Hash#rekey! from clobbering previous keys
      • Fix Exception#raised? is a class method
      • Fix Enumerator#fx should use #map instead of #each
      • Fix String#splice needs String#store
      • Fix Kernel#blank? empty condition was faulty
      • Fix Comparable#bound needs clip.rb, not cap.rb
      • Fix String#file needs to pass block
      • Fix String#edit_distance use new encodings for Ruby 1.9
    • ๐Ÿ‘Œ Improved Features

      • New lib/tour division of libraries
      • Module#class_extend dynamically creates append_features method
      • Kernel#require_all is only for relative requires
      • DIR can take subdirectory arguments
      • Hash#join has more sensible default separator (' ')
      • Some OpEsc escapes have been renamed
      • Kernel#assign does not accept a block
      • Kernel#try is now like ActiveSupport's
      • Improved #respond (which is like old #try)
      • Remove all if defined?(ActiveSupport) conditions
      • Use #random_range to support specialized Range#at_rand functionality
      • Use Comparable.[] instead of Comparable()
      • Array#rotate rotates in opposite direction than before (b/c or Ruby 1.9)