structured_warnings 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/License.txt +1 -1
- data/README.rdoc +20 -11
- data/Rakefile +46 -29
- data/doc/DeprecatedMethodWarning.html +170 -0
- data/doc/DeprecatedSignatureWarning.html +171 -0
- data/doc/DeprecationWarning.html +171 -0
- data/doc/Dynamic.html +172 -0
- data/doc/Object.html +186 -0
- data/doc/README_rdoc.html +296 -0
- data/doc/StandardWarning.html +169 -0
- data/doc/StructuredWarnings.html +187 -0
- data/doc/StructuredWarnings/ClassMethods.html +254 -0
- data/doc/StructuredWarnings/Kernel.html +274 -0
- data/doc/StructuredWarnings/Test.html +176 -0
- data/doc/StructuredWarnings/Test/Assertions.html +322 -0
- data/doc/StructuredWarnings/Test/Warner.html +271 -0
- data/doc/StructuredWarnings/Warner.html +226 -0
- data/doc/Warning.html +460 -0
- data/doc/Warning/ClassMethods.html +334 -0
- data/doc/created.rid +10 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +120 -0
- data/doc/js/darkfish.js +116 -0
- data/doc/js/jquery.js +32 -0
- data/doc/js/quicksearch.js +114 -0
- data/doc/js/thickbox-compressed.js +10 -0
- data/doc/lib/structured_warnings/dynamic_rb.html +65 -0
- data/doc/lib/structured_warnings/kernel_rb.html +52 -0
- data/doc/lib/structured_warnings/test/assertions_rb.html +52 -0
- data/doc/lib/structured_warnings/test/warner_rb.html +52 -0
- data/doc/lib/structured_warnings/test_rb.html +56 -0
- data/doc/lib/structured_warnings/warner_rb.html +52 -0
- data/doc/lib/structured_warnings/warning_rb.html +64 -0
- data/doc/lib/structured_warnings_rb.html +62 -0
- data/doc/rdoc.css +763 -0
- data/lib/structured_warnings.rb +6 -9
- data/lib/structured_warnings/dynamic.rb +6 -6
- data/lib/structured_warnings/kernel.rb +9 -9
- data/lib/structured_warnings/test.rb +2 -3
- data/lib/structured_warnings/test/assertions.rb +21 -9
- data/lib/structured_warnings/test/warner.rb +2 -2
- data/lib/structured_warnings/warner.rb +1 -1
- data/lib/structured_warnings/warning.rb +11 -11
- data/structured_warnings.gemspec +15 -58
- data/test/structured_warnings_test.rb +7 -6
- metadata +85 -62
- data/.gitignore +0 -2
- data/test/test_helper.rb +0 -4
- data/version.yml +0 -4
data/lib/structured_warnings.rb
CHANGED
@@ -1,14 +1,11 @@
|
|
1
|
-
$:.unshift File.dirname(__FILE__)
|
2
|
-
|
3
1
|
require "structured_warnings/dynamic"
|
4
2
|
require "structured_warnings/kernel"
|
5
3
|
require "structured_warnings/warner"
|
6
4
|
require "structured_warnings/warning"
|
7
5
|
|
8
|
-
|
9
6
|
module StructuredWarnings
|
10
|
-
# If you <code>require "test/unit"</code> after +structured_warnings+ you
|
11
|
-
# have to <code>require "structured_warnings/test"</code> manually,
|
7
|
+
# If you <code>require "test/unit"</code> after +structured_warnings+ you
|
8
|
+
# have to <code>require "structured_warnings/test"</code> manually,
|
12
9
|
# otherwise the test extensions will be added automatically.
|
13
10
|
module ClassMethods
|
14
11
|
# Executes a block using the given warner. This may be used to suppress
|
@@ -28,14 +25,14 @@ module StructuredWarnings
|
|
28
25
|
end
|
29
26
|
|
30
27
|
#:stopdoc:
|
31
|
-
# Sets a new warner
|
28
|
+
# Sets a new warner
|
32
29
|
def warner=(new_warner)
|
33
30
|
Dynamic[:warner] = new_warner
|
34
31
|
end
|
35
32
|
|
36
33
|
# returns an Array of all currently disabled warnings.
|
37
34
|
#
|
38
|
-
# *Note*: Everyday users are supposed to use the methods in
|
35
|
+
# *Note*: Everyday users are supposed to use the methods in
|
39
36
|
# Warning::ClassMethods
|
40
37
|
def disabled_warnings
|
41
38
|
Dynamic[:disabled_warnings]
|
@@ -44,7 +41,7 @@ module StructuredWarnings
|
|
44
41
|
# sets an array of all currently disabled warnings. It is expected that this
|
45
42
|
# array consists only of the Warning class and its subclasses.
|
46
43
|
#
|
47
|
-
# *Note*: Everyday users are supposed to use the methods in
|
44
|
+
# *Note*: Everyday users are supposed to use the methods in
|
48
45
|
# Warning::ClassMethods
|
49
46
|
def disabled_warnings=(new_disabled_warnings)
|
50
47
|
Dynamic[:disabled_warnings] = new_disabled_warnings
|
@@ -52,7 +49,7 @@ module StructuredWarnings
|
|
52
49
|
|
53
50
|
# Executes a block with the given set of disabled instances.
|
54
51
|
#
|
55
|
-
# *Note*: Everyday users are supposed to use the methods in
|
52
|
+
# *Note*: Everyday users are supposed to use the methods in
|
56
53
|
# Warning::ClassMethods
|
57
54
|
def with_disabled_warnings(disabled_warnings)
|
58
55
|
Dynamic.let(:disabled_warnings => disabled_warnings) do
|
@@ -1,8 +1,8 @@
|
|
1
|
-
# This library was created by Christian Neukirchen in the context of
|
1
|
+
# This library was created by Christian Neukirchen in the context of
|
2
2
|
# EuRuKo 2005 and is licensed under the same terms as Ruby.
|
3
3
|
#
|
4
|
-
# It provides dynamically scoped variables. It is used within
|
5
|
-
# +structured_warnings+ to store the current, thread-wide disabled warning
|
4
|
+
# It provides dynamically scoped variables. It is used within
|
5
|
+
# +structured_warnings+ to store the current, thread-wide disabled warning
|
6
6
|
# classes.
|
7
7
|
#
|
8
8
|
# For more information see the corresponding slides at
|
@@ -24,7 +24,7 @@ module Dynamic
|
|
24
24
|
def variables
|
25
25
|
Thread.current[:DYNAMIC] or here!
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
def variable(definition)
|
29
29
|
case definition
|
30
30
|
when Symbol
|
@@ -44,11 +44,11 @@ module Dynamic
|
|
44
44
|
"can't create a new dynamic variable from #{definition.class}"
|
45
45
|
end
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
48
|
def [](key)
|
49
49
|
variables[key]
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
def []=(key, value)
|
53
53
|
variables[key] = value
|
54
54
|
end
|
@@ -8,13 +8,13 @@ module StructuredWarnings
|
|
8
8
|
# warn(warning_class, message)
|
9
9
|
# warn(warning_instance)
|
10
10
|
#
|
11
|
-
# This method provides a +raise+-like interface. It extends the default
|
11
|
+
# This method provides a +raise+-like interface. It extends the default
|
12
12
|
# warn in ::Kernel to allow the use of structured warnings.
|
13
13
|
#
|
14
14
|
# Internally it uses the StructuredWarnings::warner to format a message
|
15
15
|
# based on the given warning class, the message and a stack frame.
|
16
16
|
# The return value is passed to super, which is likely the implementation
|
17
|
-
# in ::Kernel. That way, it is less likely, that structured_warnings
|
17
|
+
# in ::Kernel. That way, it is less likely, that structured_warnings
|
18
18
|
# interferes with other extensions.
|
19
19
|
#
|
20
20
|
# It the warner return nil or an empty string the underlying warn will not
|
@@ -28,7 +28,7 @@ module StructuredWarnings
|
|
28
28
|
# warn "This is an old-style warning" # This will emit a StandardWarning
|
29
29
|
#
|
30
30
|
# class Foo
|
31
|
-
# def bar
|
31
|
+
# def bar
|
32
32
|
# warn DeprecationWarning, "Never use bar again, use beer"
|
33
33
|
# end
|
34
34
|
# def beer
|
@@ -36,12 +36,12 @@ module StructuredWarnings
|
|
36
36
|
# end
|
37
37
|
# end
|
38
38
|
#
|
39
|
-
# warn Warning.new("The least specific warning you can get")
|
39
|
+
# warn Warning.new("The least specific warning you can get")
|
40
40
|
#
|
41
41
|
def warn(*args)
|
42
42
|
first = args.shift
|
43
43
|
if first.is_a? Class and first <= Warning
|
44
|
-
warning = first
|
44
|
+
warning = first
|
45
45
|
message = args.shift
|
46
46
|
|
47
47
|
elsif first.is_a? Warning
|
@@ -50,17 +50,17 @@ module StructuredWarnings
|
|
50
50
|
|
51
51
|
else
|
52
52
|
warning = StandardWarning
|
53
|
-
message = first.to_s
|
53
|
+
message = first.to_s
|
54
54
|
end
|
55
55
|
|
56
56
|
unless args.empty?
|
57
|
-
raise ArgumentError,
|
58
|
-
"wrong number of arguments (#{args.size + 2} for 2)"
|
57
|
+
raise ArgumentError,
|
58
|
+
"wrong number of arguments (#{args.size + 2} for 2)"
|
59
59
|
end
|
60
60
|
|
61
61
|
if warning.active?
|
62
62
|
output = StructuredWarnings.warner.format(warning, message, caller(1))
|
63
|
-
super(output) unless output.nil? or output.to_s.empty?
|
63
|
+
super(output) unless output.nil? or output.to_s.empty?
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
@@ -1,6 +1,5 @@
|
|
1
|
-
require "structured_warnings"
|
2
|
-
require "structured_warnings/test/
|
3
|
-
require "structured_warnings/test/assertions.rb"
|
1
|
+
require "structured_warnings/test/warner"
|
2
|
+
require "structured_warnings/test/assertions"
|
4
3
|
|
5
4
|
Test::Unit::TestCase.class_eval do
|
6
5
|
include StructuredWarnings::Test::Assertions
|
@@ -21,14 +21,18 @@ module StructuredWarnings
|
|
21
21
|
# assert_no_warn() { foo } # fails
|
22
22
|
#
|
23
23
|
# See assert_warn for more examples.
|
24
|
+
#
|
25
|
+
# *Note*: It is currently not possible to add a custom failure message.
|
24
26
|
def assert_no_warn(*args)
|
25
27
|
warning, message = parse_arguments(args)
|
26
28
|
|
27
29
|
w = StructuredWarnings::Test::Warner.new
|
28
|
-
StructuredWarnings::with_warner(w) do
|
30
|
+
StructuredWarnings::with_warner(w) do
|
29
31
|
yield
|
30
32
|
end
|
31
|
-
|
33
|
+
assert_block("<#{args_inspect(args)}> has been emitted.") do
|
34
|
+
!w.warned?(warning, message)
|
35
|
+
end
|
32
36
|
end
|
33
37
|
|
34
38
|
# :call-seq:
|
@@ -45,9 +49,9 @@ module StructuredWarnings
|
|
45
49
|
# end
|
46
50
|
#
|
47
51
|
# # passes
|
48
|
-
# assert_warn(DeprecatedMethodWarning) { foo }
|
49
|
-
# assert_warn(DeprecationWarning) { foo }
|
50
|
-
# assert_warn() { foo }
|
52
|
+
# assert_warn(DeprecatedMethodWarning) { foo }
|
53
|
+
# assert_warn(DeprecationWarning) { foo }
|
54
|
+
# assert_warn() { foo }
|
51
55
|
# assert_warn(Warning, "used foo, use bar instead") { foo }
|
52
56
|
# assert_warn(Warning, /use bar/) { foo }
|
53
57
|
# assert_warn(Warning.new("used foo, use bar instead")) { foo }
|
@@ -57,18 +61,22 @@ module StructuredWarnings
|
|
57
61
|
# assert_warn(Warning, /deprecated/) { foo }
|
58
62
|
# assert_warn(Warning.new) { foo }
|
59
63
|
#
|
64
|
+
# *Note*: It is currently not possible to add a custom failure message.
|
60
65
|
def assert_warn(*args)
|
61
66
|
warning, message = parse_arguments(args)
|
62
67
|
|
63
68
|
w = StructuredWarnings::Test::Warner.new
|
64
|
-
StructuredWarnings::with_warner(w) do
|
69
|
+
StructuredWarnings::with_warner(w) do
|
65
70
|
yield
|
66
71
|
end
|
67
|
-
|
72
|
+
assert_block("<#{args_inspect(args)}> has not been emitted.") do
|
73
|
+
w.warned?(warning, message)
|
74
|
+
end
|
68
75
|
end
|
69
76
|
|
70
77
|
private
|
71
78
|
def parse_arguments(args)
|
79
|
+
args = args.clone
|
72
80
|
first = args.shift
|
73
81
|
if first.is_a? Class and first <= Warning
|
74
82
|
warning = first
|
@@ -88,12 +96,16 @@ module StructuredWarnings
|
|
88
96
|
end
|
89
97
|
|
90
98
|
unless args.empty?
|
91
|
-
raise ArgumentError,
|
92
|
-
"wrong number of arguments (#{args.size + 2} for 2)"
|
99
|
+
raise ArgumentError,
|
100
|
+
"wrong number of arguments (#{args.size + 2} for 2)"
|
93
101
|
end
|
94
102
|
|
95
103
|
return warning, message
|
96
104
|
end
|
105
|
+
|
106
|
+
def args_inspect(args)
|
107
|
+
args.map { |a| a.inspect }.join(", ")
|
108
|
+
end
|
97
109
|
end
|
98
110
|
end
|
99
111
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module StructuredWarnings
|
2
2
|
module Test
|
3
|
-
# This warner is used in Assertions#assert_warn and
|
4
|
-
# Assertions#assert_no_warn blocks. It captures all warnings in format and
|
3
|
+
# This warner is used in Assertions#assert_warn and
|
4
|
+
# Assertions#assert_no_warn blocks. It captures all warnings in format and
|
5
5
|
# provides access to them using the warned? method.
|
6
6
|
class Warner < StructuredWarnings::Warner
|
7
7
|
# Overrides the public interface of StructuredWarnings::Warner. This
|
@@ -5,7 +5,7 @@ module StructuredWarnings
|
|
5
5
|
# the place where the "thing that caused the warning" resides.
|
6
6
|
class Warner
|
7
7
|
# Warner.new.format(DeprecationWarning, "more info..", caller)
|
8
|
-
# # => "demo.rb:5 : more info.. (DeprecationWarning)"
|
8
|
+
# # => "demo.rb:5 : more info.. (DeprecationWarning)"
|
9
9
|
def format(warning, message, stack)
|
10
10
|
"#{stack.shift} : #{message} (#{warning})"
|
11
11
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
# Descendents of class Warning are used to raise structured warnings. They
|
1
|
+
# Descendents of class Warning are used to raise structured warnings. They
|
2
2
|
# programmers to explicitly supress certain kinds of warnings and provide
|
3
3
|
# additional information in contrast to the plain warn method. They
|
4
4
|
# implement an Exception-like interface and carry information about the
|
5
|
-
# warning -- its type (the warning's class name), an optional descriptive
|
6
|
-
# string, and optional traceback information. Programs may subclass Warning
|
5
|
+
# warning -- its type (the warning's class name), an optional descriptive
|
6
|
+
# string, and optional traceback information. Programs may subclass Warning
|
7
7
|
# to add additional information.
|
8
8
|
#
|
9
9
|
# Large portions of this class's documentation are taken from the Exception
|
@@ -18,7 +18,7 @@ class Warning
|
|
18
18
|
|
19
19
|
# call-seq:
|
20
20
|
# warning.backtrace => array
|
21
|
-
#
|
21
|
+
#
|
22
22
|
# Returns any backtrace associated with the warning. The backtrace
|
23
23
|
# is an array of strings, each containing either ``filename:lineNo: in
|
24
24
|
# `method''' or ``filename:lineNo.''
|
@@ -26,11 +26,11 @@ class Warning
|
|
26
26
|
@backtrace
|
27
27
|
end
|
28
28
|
|
29
|
-
# Sets the backtrace information associated with warning. The argument must
|
30
|
-
# be an array of String objects in the format described in
|
29
|
+
# Sets the backtrace information associated with warning. The argument must
|
30
|
+
# be an array of String objects in the format described in
|
31
31
|
# Exception#backtrace.
|
32
32
|
def set_backtrace(backtrace)
|
33
|
-
@backtrace = backtrace
|
33
|
+
@backtrace = backtrace
|
34
34
|
end
|
35
35
|
|
36
36
|
# Returns warning's message (or the name of the warning if no message is set).
|
@@ -115,15 +115,15 @@ end
|
|
115
115
|
# This warning is used when calling #Kernel.warn without arguments.
|
116
116
|
class StandardWarning < Warning; end
|
117
117
|
|
118
|
-
# This is a general warning used to mark certain actions as deprecated. We
|
118
|
+
# This is a general warning used to mark certain actions as deprecated. We
|
119
119
|
# recommend to add a useful warning message, which alternative to use instead.
|
120
120
|
class DeprecationWarning < Warning; end
|
121
121
|
|
122
|
-
# This warning marks single methods as deprecated. We
|
122
|
+
# This warning marks single methods as deprecated. We
|
123
123
|
# recommend to add a useful warning message, which alternative to use instead.
|
124
124
|
class DeprecatedMethodWarning < DeprecationWarning; end
|
125
125
|
|
126
|
-
# This warning marks the given parameters for a certain methods as
|
127
|
-
# deprecated. We recommend to add a useful warning message, which
|
126
|
+
# This warning marks the given parameters for a certain methods as
|
127
|
+
# deprecated. We recommend to add a useful warning message, which
|
128
128
|
# alternative to use instead.
|
129
129
|
class DeprecatedSignatureWarning < DeprecationWarning; end
|
data/structured_warnings.gemspec
CHANGED
@@ -1,63 +1,20 @@
|
|
1
|
-
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
1
|
+
require 'rubygems'
|
5
2
|
|
6
3
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
4
|
+
s.name = 'structured_warnings'
|
5
|
+
s.version = '0.1.4'
|
6
|
+
s.author = 'Gregor Schmidt'
|
7
|
+
s.email = 'ruby@schmidtwisser.de'
|
8
|
+
s.homepage = 'http://github.com/schmidt/structured_warnings'
|
9
|
+
s.summary = 'Provides structured warnings for Ruby, using an exception-like interface and hierarchy'
|
10
|
+
s.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
11
|
+
s.test_files = Dir['test/*.rb']
|
9
12
|
|
10
|
-
s.
|
11
|
-
s.
|
12
|
-
s.date = %q{2009-11-28}
|
13
|
-
s.description = %q{This is an implementation of Daniel Berger's proposal of structured warnings for Ruby.}
|
14
|
-
s.email = %q{ruby@schmidtwisser.de}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"README.rdoc"
|
17
|
-
]
|
18
|
-
s.files = [
|
19
|
-
".gitignore",
|
20
|
-
"History.txt",
|
21
|
-
"License.txt",
|
22
|
-
"README.rdoc",
|
23
|
-
"Rakefile",
|
24
|
-
"lib/structured_warnings.rb",
|
25
|
-
"lib/structured_warnings/dynamic.rb",
|
26
|
-
"lib/structured_warnings/kernel.rb",
|
27
|
-
"lib/structured_warnings/test.rb",
|
28
|
-
"lib/structured_warnings/test/assertions.rb",
|
29
|
-
"lib/structured_warnings/test/warner.rb",
|
30
|
-
"lib/structured_warnings/warner.rb",
|
31
|
-
"lib/structured_warnings/warning.rb",
|
32
|
-
"structured_warnings.gemspec",
|
33
|
-
"test/structured_warnings_test.rb",
|
34
|
-
"test/test_helper.rb",
|
35
|
-
"version.yml"
|
36
|
-
]
|
37
|
-
s.homepage = %q{http://github.com/schmidt/structured_warnings}
|
38
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
39
|
-
s.require_paths = ["lib"]
|
40
|
-
s.rubygems_version = %q{1.3.5}
|
41
|
-
s.summary = %q{Provides structured warnings for Ruby, using an exception-like interface and hierarchy.}
|
42
|
-
s.test_files = [
|
43
|
-
"test/structured_warnings_test.rb",
|
44
|
-
"test/test_helper.rb"
|
45
|
-
]
|
13
|
+
s.rdoc_options = ['--charset=UTF-8']
|
14
|
+
s.extra_rdoc_files = ['README.rdoc']
|
46
15
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
52
|
-
s.add_development_dependency(%q<rake>, [">= 0"])
|
53
|
-
s.add_development_dependency(%q<jeweler>, [">= 1.4.0"])
|
54
|
-
else
|
55
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
56
|
-
s.add_dependency(%q<jeweler>, [">= 1.4.0"])
|
57
|
-
end
|
58
|
-
else
|
59
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
60
|
-
s.add_dependency(%q<jeweler>, [">= 1.4.0"])
|
61
|
-
end
|
16
|
+
s.description = %Q{
|
17
|
+
This is an implementation of Daniel Berger's proposal of structured
|
18
|
+
warnings for Ruby.
|
19
|
+
}
|
62
20
|
end
|
63
|
-
|
@@ -1,15 +1,16 @@
|
|
1
|
-
require
|
1
|
+
require 'test/unit'
|
2
|
+
require 'structured_warnings'
|
2
3
|
|
3
4
|
class Foo
|
4
5
|
def old_method
|
5
|
-
warn DeprecatedMethodWarning,
|
6
|
+
warn DeprecatedMethodWarning,
|
6
7
|
'This method is deprecated. Use new_method instead'
|
7
8
|
end
|
8
9
|
end
|
9
10
|
|
10
11
|
class StructuredWarningsTest < Test::Unit::TestCase
|
11
12
|
def test_warn
|
12
|
-
assert_warn(DeprecatedMethodWarning) do
|
13
|
+
assert_warn(DeprecatedMethodWarning) do
|
13
14
|
Foo.new.old_method
|
14
15
|
end
|
15
16
|
end
|
@@ -125,8 +126,8 @@ class StructuredWarningsTest < Test::Unit::TestCase
|
|
125
126
|
end
|
126
127
|
|
127
128
|
def test_warnings_may_not_be_disabled_twice
|
128
|
-
|
129
|
-
|
130
|
-
|
129
|
+
assert_equal [Warning], Warning.disable
|
130
|
+
assert_equal [Warning], Warning.disable
|
131
|
+
assert_equal [], Warning.enable
|
131
132
|
end
|
132
133
|
end
|
metadata
CHANGED
@@ -1,91 +1,114 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: structured_warnings
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.4
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
|
-
authors:
|
7
|
+
authors:
|
7
8
|
- Gregor Schmidt
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: rake
|
17
|
-
type: :development
|
18
|
-
version_requirement:
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: "0"
|
24
|
-
version:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: jeweler
|
27
|
-
type: :development
|
28
|
-
version_requirement:
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.4.0
|
34
|
-
version:
|
35
|
-
description: This is an implementation of Daniel Berger's proposal of structured warnings for Ruby.
|
12
|
+
date: 2013-04-26 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: ! "\n This is an implementation of Daniel Berger's proposal of structured\n
|
15
|
+
\ warnings for Ruby.\n "
|
36
16
|
email: ruby@schmidtwisser.de
|
37
17
|
executables: []
|
38
|
-
|
39
18
|
extensions: []
|
40
|
-
|
41
|
-
extra_rdoc_files:
|
19
|
+
extra_rdoc_files:
|
42
20
|
- README.rdoc
|
43
|
-
files:
|
44
|
-
- .
|
21
|
+
files:
|
22
|
+
- doc/created.rid
|
23
|
+
- doc/DeprecatedMethodWarning.html
|
24
|
+
- doc/DeprecatedSignatureWarning.html
|
25
|
+
- doc/DeprecationWarning.html
|
26
|
+
- doc/Dynamic.html
|
27
|
+
- doc/images/brick.png
|
28
|
+
- doc/images/brick_link.png
|
29
|
+
- doc/images/bug.png
|
30
|
+
- doc/images/bullet_black.png
|
31
|
+
- doc/images/bullet_toggle_minus.png
|
32
|
+
- doc/images/bullet_toggle_plus.png
|
33
|
+
- doc/images/date.png
|
34
|
+
- doc/images/find.png
|
35
|
+
- doc/images/loadingAnimation.gif
|
36
|
+
- doc/images/macFFBgHack.png
|
37
|
+
- doc/images/package.png
|
38
|
+
- doc/images/page_green.png
|
39
|
+
- doc/images/page_white_text.png
|
40
|
+
- doc/images/page_white_width.png
|
41
|
+
- doc/images/plugin.png
|
42
|
+
- doc/images/ruby.png
|
43
|
+
- doc/images/tag_green.png
|
44
|
+
- doc/images/wrench.png
|
45
|
+
- doc/images/wrench_orange.png
|
46
|
+
- doc/images/zoom.png
|
47
|
+
- doc/index.html
|
48
|
+
- doc/js/darkfish.js
|
49
|
+
- doc/js/jquery.js
|
50
|
+
- doc/js/quicksearch.js
|
51
|
+
- doc/js/thickbox-compressed.js
|
52
|
+
- doc/lib/structured_warnings/dynamic_rb.html
|
53
|
+
- doc/lib/structured_warnings/kernel_rb.html
|
54
|
+
- doc/lib/structured_warnings/test/assertions_rb.html
|
55
|
+
- doc/lib/structured_warnings/test/warner_rb.html
|
56
|
+
- doc/lib/structured_warnings/test_rb.html
|
57
|
+
- doc/lib/structured_warnings/warner_rb.html
|
58
|
+
- doc/lib/structured_warnings/warning_rb.html
|
59
|
+
- doc/lib/structured_warnings_rb.html
|
60
|
+
- doc/Object.html
|
61
|
+
- doc/rdoc.css
|
62
|
+
- doc/README_rdoc.html
|
63
|
+
- doc/StandardWarning.html
|
64
|
+
- doc/StructuredWarnings/ClassMethods.html
|
65
|
+
- doc/StructuredWarnings/Kernel.html
|
66
|
+
- doc/StructuredWarnings/Test/Assertions.html
|
67
|
+
- doc/StructuredWarnings/Test/Warner.html
|
68
|
+
- doc/StructuredWarnings/Test.html
|
69
|
+
- doc/StructuredWarnings/Warner.html
|
70
|
+
- doc/StructuredWarnings.html
|
71
|
+
- doc/Warning/ClassMethods.html
|
72
|
+
- doc/Warning.html
|
45
73
|
- History.txt
|
46
|
-
- License.txt
|
47
|
-
- README.rdoc
|
48
|
-
- Rakefile
|
49
|
-
- lib/structured_warnings.rb
|
50
74
|
- lib/structured_warnings/dynamic.rb
|
51
75
|
- lib/structured_warnings/kernel.rb
|
52
|
-
- lib/structured_warnings/test.rb
|
53
76
|
- lib/structured_warnings/test/assertions.rb
|
54
77
|
- lib/structured_warnings/test/warner.rb
|
78
|
+
- lib/structured_warnings/test.rb
|
55
79
|
- lib/structured_warnings/warner.rb
|
56
80
|
- lib/structured_warnings/warning.rb
|
81
|
+
- lib/structured_warnings.rb
|
82
|
+
- License.txt
|
83
|
+
- Rakefile
|
84
|
+
- README.rdoc
|
57
85
|
- structured_warnings.gemspec
|
58
86
|
- test/structured_warnings_test.rb
|
59
|
-
- test/test_helper.rb
|
60
|
-
- version.yml
|
61
|
-
has_rdoc: true
|
62
87
|
homepage: http://github.com/schmidt/structured_warnings
|
63
88
|
licenses: []
|
64
|
-
|
65
89
|
post_install_message:
|
66
|
-
rdoc_options:
|
90
|
+
rdoc_options:
|
67
91
|
- --charset=UTF-8
|
68
|
-
require_paths:
|
92
|
+
require_paths:
|
69
93
|
- lib
|
70
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ! '>='
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
82
106
|
requirements: []
|
83
|
-
|
84
107
|
rubyforge_project:
|
85
|
-
rubygems_version: 1.
|
108
|
+
rubygems_version: 1.8.25
|
86
109
|
signing_key:
|
87
110
|
specification_version: 3
|
88
|
-
summary: Provides structured warnings for Ruby, using an exception-like interface
|
89
|
-
|
111
|
+
summary: Provides structured warnings for Ruby, using an exception-like interface
|
112
|
+
and hierarchy
|
113
|
+
test_files:
|
90
114
|
- test/structured_warnings_test.rb
|
91
|
-
- test/test_helper.rb
|