Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved the at_exit hook into warnings/warnings.rb.

  • Loading branch information...
commit 93bd44d903ed0ccfbd55bac31899075f7acfd865 1 parent 098b41b
@postmodern authored
Showing with 18 additions and 18 deletions.
  1. +0 −18 lib/warnings.rb
  2. +18 −0 lib/warnings/warnings.rb
View
18 lib/warnings.rb
@@ -3,21 +3,3 @@
require 'warnings/mixin'
include Warnings::Mixin
-
-at_exit do
- if (!$WARNINGS.empty? && ($VERBOSE || $DEBUG))
- $stderr.puts
- $stderr.puts "Warnings:"
- $stderr.puts
-
- unique_warnings = {}
-
- $WARNINGS.each do |warning|
- unique_warnings[warning.source_location] ||= warning
- end
-
- unique_warnings.each_value { |warning| warning.print }
-
- $stderr.puts
- end
-end
View
18 lib/warnings/warnings.rb
@@ -2,6 +2,24 @@ module Warnings
# The global list of warnings
$WARNINGS ||= []
+ at_exit do
+ if (!$WARNINGS.empty? && ($VERBOSE || $DEBUG))
+ $stderr.puts
+ $stderr.puts 'Warnings:'
+ $stderr.puts
+
+ unique_warnings = {}
+
+ $WARNINGS.each do |warning|
+ unique_warnings[warning.source_location] ||= warning
+ end
+
+ unique_warnings.each_value { |warning| warning.print }
+
+ $stderr.puts
+ end
+ end
+
#
# Selects all warnings with a similar message.
#
Please sign in to comment.
Something went wrong with that request. Please try again.