Changeset 2179
- Timestamp:
- 09/11/05 04:58:27 (3 years ago)
- Files:
-
- trunk/actionmailer/lib/action_mailer.rb (modified) (1 diff)
- trunk/actionpack/test/controller/helper_test.rb (modified) (1 diff)
- trunk/actionpack/test/template/form_helper_test.rb (modified) (1 diff)
- trunk/actionpack/test/template/form_options_helper_test.rb (modified) (1 diff)
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support.rb (modified) (1 diff)
- trunk/activesupport/lib/active_support/core_ext/kernel.rb (modified) (1 diff)
- trunk/activesupport/lib/active_support/misc.rb (deleted)
- trunk/activesupport/test/core_ext/kernel_test.rb (moved) (moved from trunk/activesupport/test/misc_test.rb) (1 diff)
- trunk/activesupport/test/core_ext/string_ext_test.rb (modified) (1 diff)
- trunk/activesupport/test/dependencies_test.rb (modified) (1 diff)
- trunk/railties/lib/initializer.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionmailer/lib/action_mailer.rb
r2130 r2179 49 49 end 50 50 51 old_verbose, $VERBOSE = $VERBOSE, nil 52 TMail::Encoder.const_set("MAX_LINE_LEN", 200) 53 $VERBOSE = old_verbose 51 silence_warnings { TMail::Encoder.const_set("MAX_LINE_LEN", 200) } trunk/actionpack/test/controller/helper_test.rb
r1425 r2179 122 122 123 123 def test_helper=(helper_module) 124 old_verbose, $VERBOSE = $VERBOSE, nil 125 self.class.const_set('TestHelper', helper_module) 126 $VERBOSE = old_verbose 124 silence_warnings { self.class.const_set('TestHelper', helper_module) } 127 125 end 128 126 end trunk/actionpack/test/template/form_helper_test.rb
r1789 r2179 7 7 include ActionView::Helpers::FormHelper 8 8 9 old_verbose, $VERBOSE = $VERBOSE, nil 10 Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on, :cost) 11 Post.class_eval do 12 alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast) 13 alias_method :body_before_type_cast, :body unless respond_to?(:body_before_type_cast) 14 alias_method :author_name_before_type_cast, :author_name unless respond_to?(:author_name_before_type_cast) 9 silence_warnings do 10 Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on, :cost) 11 Post.class_eval do 12 alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast) 13 alias_method :body_before_type_cast, :body unless respond_to?(:body_before_type_cast) 14 alias_method :author_name_before_type_cast, :author_name unless respond_to?(:author_name_before_type_cast) 15 end 15 16 end 16 $VERBOSE = old_verbose17 17 18 18 def setup trunk/actionpack/test/template/form_options_helper_test.rb
r1646 r2179 26 26 include ActionView::Helpers::FormOptionsHelper 27 27 28 old_verbose, $VERBOSE = $VERBOSE, nil29 Post = Struct.new('Post', :title, :author_name, :body, :secret, :written_on, :category, :origin)30 Continent = Struct.new('Continent', :continent_name, :countries)31 Country = Struct.new('Country', :country_id, :country_name)32 Firm = Struct.new('Firm', :time_zone)33 $VERBOSE = old_verbose28 silence_warnings do 29 Post = Struct.new('Post', :title, :author_name, :body, :secret, :written_on, :category, :origin) 30 Continent = Struct.new('Continent', :continent_name, :countries) 31 Country = Struct.new('Country', :country_id, :country_name) 32 Firm = Struct.new('Firm', :time_zone) 33 end 34 34 35 35 def test_collection_options trunk/activesupport/CHANGELOG
r2171 r2179 1 1 *SVN* 2 3 * Added Kernel#silence_warnings to turn off warnings temporarily for the passed block 2 4 3 5 * Added String#starts_with? and String#ends_with? #2118 [thijs@vandervossen.net] trunk/activesupport/lib/active_support.rb
r838 r2179 30 30 require 'active_support/core_ext' 31 31 require 'active_support/clean_logger' 32 require 'active_support/misc'33 32 require 'active_support/dependencies' 34 33 trunk/activesupport/lib/active_support/core_ext/kernel.rb
r1207 r2179 15 15 value 16 16 end 17 18 # Sets $VERBOSE to nil for the duration of the block and back to its original value afterwards. 19 # 20 # silence_warnings do 21 # noisy_call # no warning voiced 22 # end 23 # 24 # noisy_call # warning voiced 25 def silence_warnings 26 old_verbose, $VERBOSE = $VERBOSE, nil 27 yield 28 ensure 29 $VERBOSE = old_verbose 30 end 17 31 end trunk/activesupport/test/core_ext/kernel_test.rb
r624 r2179 1 1 require 'test/unit' 2 require File.dirname(__FILE__) + '/../ lib/active_support/misc'2 require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/kernel' 3 3 4 class MiscTest < Test::Unit::TestCase4 class KernelTest < Test::Unit::TestCase 5 5 def test_silence_warnings 6 6 silence_warnings { assert_nil $VERBOSE } trunk/activesupport/test/core_ext/string_ext_test.rb
r2171 r2179 1 1 require 'test/unit' 2 require 'date' 2 3 require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/string' 3 require File.dirname(__FILE__) + '/../../lib/active_support/ misc'4 require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/kernel' 4 5 5 6 silence_warnings do trunk/activesupport/test/dependencies_test.rb
r624 r2179 1 1 require 'test/unit' 2 2 $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib/active_support/' 3 require 'misc'4 3 require 'dependencies' 5 4 trunk/railties/lib/initializer.rb
r2134 r2179 77 77 end 78 78 79 old_verbose, $VERBOSE = $VERBOSE, nil 80 Object.const_set "RAILS_DEFAULT_LOGGER", logger 81 $VERBOSE = old_verbose 79 silence_warnings { Object.const_set "RAILS_DEFAULT_LOGGER", logger } 82 80 end 83 81