diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-23 06:48:05 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-23 06:48:05 -0700 |
commit | a5fb1c61755f03a8c75b0a434fb2aca57502293b (patch) | |
tree | 093d94f72e157c71baaf8a3e749f4e4c20781bfd /activesupport/lib | |
parent | 5c3f3f10babe01ec0b6ae04a8846b5598d107926 (diff) | |
parent | 2514d65ca2b92f57b52e8027f6ab6fc8601df92f (diff) | |
download | rails-a5fb1c61755f03a8c75b0a434fb2aca57502293b.tar.gz rails-a5fb1c61755f03a8c75b0a434fb2aca57502293b.tar.bz2 rails-a5fb1c61755f03a8c75b0a434fb2aca57502293b.zip |
Merge pull request #1231 from joshk/ruby-debugger
Ruby debugger corrections
Diffstat (limited to 'activesupport/lib')
3 files changed, 1 insertions, 34 deletions
diff --git a/activesupport/lib/active_support/core_ext/kernel.rb b/activesupport/lib/active_support/core_ext/kernel.rb index 01cfe7fc10..0275f4c037 100644 --- a/activesupport/lib/active_support/core_ext/kernel.rb +++ b/activesupport/lib/active_support/core_ext/kernel.rb @@ -1,5 +1,4 @@ require 'active_support/core_ext/kernel/reporting' require 'active_support/core_ext/kernel/agnostics' -require 'active_support/core_ext/kernel/requires' require 'active_support/core_ext/kernel/debugger' require 'active_support/core_ext/kernel/singleton_class' diff --git a/activesupport/lib/active_support/core_ext/kernel/debugger.rb b/activesupport/lib/active_support/core_ext/kernel/debugger.rb index 692340c7c7..7516f41e0b 100644 --- a/activesupport/lib/active_support/core_ext/kernel/debugger.rb +++ b/activesupport/lib/active_support/core_ext/kernel/debugger.rb @@ -5,12 +5,6 @@ module Kernel message = "\n***** Debugger requested, but was not available (ensure ruby-debug is listed in Gemfile/installed as gem): Start server with --debugger to enable *****\n" defined?(Rails) ? Rails.logger.info(message) : $stderr.puts(message) end - end - - undef :breakpoint if respond_to?(:breakpoint) - def breakpoint - message = "\n***** The 'breakpoint' command has been renamed 'debugger' -- please change *****\n" - defined?(Rails) ? Rails.logger.info(message) : $stderr.puts(message) - debugger + alias breakpoint debugger unless respond_to?(:breakpoint) end end diff --git a/activesupport/lib/active_support/core_ext/kernel/requires.rb b/activesupport/lib/active_support/core_ext/kernel/requires.rb deleted file mode 100644 index 3bf46271d7..0000000000 --- a/activesupport/lib/active_support/core_ext/kernel/requires.rb +++ /dev/null @@ -1,26 +0,0 @@ -require 'active_support/core_ext/kernel/reporting' - -module Kernel - # Require a library with fallback to RubyGems. Warnings during library - # loading are silenced to increase signal/noise for application warnings. - def require_library_or_gem(library_name) - silence_warnings do - begin - require library_name - rescue LoadError => cannot_require - # 1. Requiring the module is unsuccessful, maybe it's a gem and nobody required rubygems yet. Try. - begin - require 'rubygems' - rescue LoadError # => rubygems_not_installed - raise cannot_require - end - # 2. Rubygems is installed and loaded. Try to load the library again - begin - require library_name - rescue LoadError # => gem_not_installed - raise cannot_require - end - end - end - end -end |