Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 7658

Show
Ignore:
Timestamp:
09/27/07 10:38:37 (2 years ago)
Author:
bitsweat
Message:

Alias Object#send to send! for Ruby 1.9 forward compatibility.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/CHANGELOG

    r7649 r7658  
    11*SVN* 
     2 
     3* Alias Object#send to send! for Ruby 1.9 forward compatibility.  [Jeremy Kemper] 
    24 
    35* Backport Object#instance_variable_defined? for Ruby < 1.8.6.  [Jeremy Kemper] 
  • trunk/activesupport/lib/active_support/core_ext/object/misc.rb

    r7474 r7658  
    11class Object 
     2  unless respond_to?(:send!) 
     3    # Anticipating Ruby 1.9 neutering send 
     4    alias send! send 
     5  end 
     6 
    27  # A Ruby-ized realization of the K combinator, courtesy of Mikael Brockman. 
    38  # 
  • trunk/activesupport/test/core_ext/object_and_class_ext_test.rb

    r7654 r7658  
    109109 
    110110class ObjectTests < Test::Unit::TestCase 
     111  def test_send_bang_aliases_send_before_19 
     112    assert_respond_to 'a', :send! 
     113    assert_equal 1, 'a'.send!(:size) 
     114  end 
     115 
    111116  def test_suppress_re_raises 
    112117    assert_raises(LoadError) { suppress(ArgumentError) {raise LoadError} }