structured_warnings 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d6ae32c5d463eb0efeba1057728863feb4d4dcbce402934626f3423efb545b6
4
- data.tar.gz: a9f5fd53fa29a245d0190a27d4743225ea02af03fdcd04865d14625a3c9bfdc4
3
+ metadata.gz: a8774c997cadba9d8da089be20d8486231f1b3719cdd0aa3c316950d3e7b8000
4
+ data.tar.gz: 4fe13678cdbc0151442e8777822090d94204348efa25c479881b5796dff9d0d0
5
5
  SHA512:
6
- metadata.gz: 3e0245fce924551f6881319642edba0685abe1a16b4e572b8532789c4188b9a529a9fd629125c10e27e0dbccc7bee1caef394fd690775e62de0769763d112d98
7
- data.tar.gz: 6625b90aca3e9c0245608bdb3b81c4fb882c9f564a40abc29aaa598909e93a08ac2a99bdd4921284561c9253125f0d68e3191d92a3fb81068b36d30c246570d6
6
+ metadata.gz: 51311c54bb3fe552f48d3b5def0c61708da3051a1b76c3888987085531ad9b260dec4d4d3f6d563d9cb7fcf0f81f15044e8c61023331b41fc9471c6bfe91deb7
7
+ data.tar.gz: 734fa0958d804c8e7ea308c2a0f35b4c9899761e6552f203e51ad5091e6463bcb52bc519e6f0f9e0a93e894d21b6565a96f42e2d6df4e0214eb125ab81f4b0f0
data/README.md CHANGED
@@ -33,24 +33,9 @@ Or install it yourself as:
33
33
 
34
34
  ## Compatibility
35
35
 
36
- `structured_warnings` aims to work with all Ruby interpreters. Please file a bug
37
- for any incompatibilities.
38
-
39
-
40
- Versions of `structured_warnings` before `v0.3.0` are incompatible with Ruby
41
- 2.4+. Please upgrade accordingly, if you need Ruby 2.4 compatibility. Please
42
- note on the otherhand, that many class names changed in an incompatible way
43
- with `structured_warnings` `v0.3.0`. This was done to avoid future name clashes.
44
-
45
- Here's a table which should ease upgrading.
46
-
47
- | v0.2.0 and before | v0.3.0 and after |
48
- |------------------------------|--------------------------------------------------|
49
- | `Warning` | `StructuredWarnings::Base` |
50
- | `StandardWarning` | `StructuredWarnings::StandardWarning` |
51
- | `DeprecationWarning` | `StructuredWarnings::DeprecationWarning` |
52
- | `DeprecatedMethodWarning` | `StructuredWarnings::DeprecatedMethodWarning` |
53
- | `DeprecatedSignatureWarning` | `StructuredWarnings::DeprecatedSignatureWarning` |
36
+ `structured_warnings` aims to work with all stable, maintained Ruby versions. At
37
+ the time of this writing this is Ruby 3.2, 3.3, and 3.4. Please file a bug for
38
+ any incompatibilities.
54
39
 
55
40
 
56
41
  ### Test framework support
@@ -169,7 +154,7 @@ give as much feedback to your users as possible.
169
154
  * [Implementation Highlights](http://www.nach-vorne.de/2008/2/22/structured_warnings-highlights)
170
155
  * [Project's website](https://github.com/schmidt/structured_warnings/)
171
156
  * [API doc](http://rdoc.info/projects/schmidt/structured_warnings)
172
- * [Build status](https://travis-ci.org/schmidt/structured_warnings)
157
+ * [Build status](https://github.com/schmidt/structured_warnings/actions)
173
158
 
174
159
 
175
160
  ## Development
@@ -1,6 +1,6 @@
1
1
  module StructuredWarnings::Kernel
2
- def warn(*args)
3
- Warning.warn(*args)
2
+ def warn(*args, **opts)
3
+ Warning.warn(*args, **opts)
4
4
  end
5
5
  end
6
6
 
@@ -1,3 +1,3 @@
1
1
  module StructuredWarnings
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -36,7 +36,7 @@ module StructuredWarnings::Warning
36
36
  #
37
37
  # warn StructuredWarnings::Base.new("The least specific warning you can get")
38
38
  #
39
- def warn(*args)
39
+ def warn(*args, **options)
40
40
  first = args.shift
41
41
  if first.is_a? Class and first <= StructuredWarnings::Base
42
42
  warning = first
@@ -52,11 +52,9 @@ module StructuredWarnings::Warning
52
52
 
53
53
  else
54
54
  warning = StructuredWarnings::BuiltInWarning
55
- message = first.to_s.split(':', 4).last[1..-2]
55
+ message = first.to_s.split(':', 4).last.strip
56
56
  end
57
57
 
58
- options = args.first.is_a?(Hash) ? args.shift : {}
59
-
60
58
  # If args is not empty, user passed an incompatible set of arguments.
61
59
  # Maybe somebody else is overriding warn as well and knows, what to do.
62
60
  # Better do nothing in this case. See #5
@@ -1,8 +1,5 @@
1
1
  require 'structured_warnings/version'
2
2
 
3
- # Compatibility layer
4
- require 'warning' unless defined? ::Warning
5
-
6
3
  require 'dynamic'
7
4
 
8
5
  module StructuredWarnings
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structured_warnings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregor Schmidt
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2019-09-01 00:00:00.000000000 Z
10
+ date: 2025-04-15 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -16,28 +15,28 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '1.14'
18
+ version: '2.1'
20
19
  type: :development
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '1.14'
25
+ version: '2.1'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: rake
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: '10.0'
32
+ version: '13.0'
34
33
  type: :development
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: '10.0'
39
+ version: '13.0'
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: minitest
43
42
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +57,14 @@ dependencies:
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: '3.2'
60
+ version: '3.0'
62
61
  type: :development
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: '3.2'
67
+ version: '3.0'
69
68
  description: This is an implementation of Daniel Berger's proposal of structured warnings
70
69
  for Ruby.
71
70
  email:
@@ -87,12 +86,10 @@ files:
87
86
  - lib/structured_warnings/version.rb
88
87
  - lib/structured_warnings/warner.rb
89
88
  - lib/structured_warnings/warning.rb
90
- - lib/warning.rb
91
89
  homepage: http://github.com/schmidt/structured_warnings
92
90
  licenses:
93
91
  - MIT
94
92
  metadata: {}
95
- post_install_message:
96
93
  rdoc_options: []
97
94
  require_paths:
98
95
  - lib
@@ -100,15 +97,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
97
  requirements:
101
98
  - - ">="
102
99
  - !ruby/object:Gem::Version
103
- version: '0'
100
+ version: 3.2.0
104
101
  required_rubygems_version: !ruby/object:Gem::Requirement
105
102
  requirements:
106
103
  - - ">="
107
104
  - !ruby/object:Gem::Version
108
105
  version: '0'
109
106
  requirements: []
110
- rubygems_version: 3.0.6
111
- signing_key:
107
+ rubygems_version: 3.6.2
112
108
  specification_version: 4
113
109
  summary: Provides structured warnings for Ruby, using an exception-like interface
114
110
  and hierarchy
data/lib/warning.rb DELETED
@@ -1,9 +0,0 @@
1
- module Warning
2
- KERNEL_WARN = Kernel.instance_method(:warn).bind(self)
3
-
4
- def warn(*args)
5
- KERNEL_WARN.call(*args)
6
- end
7
-
8
- extend self
9
- end