pronto-annotations_formatter 0.1.0 → 0.2.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: d47d54a34a7ae4c0581de64e31dd7ee51d953ae6d6f8a7e2d87c3b90c0d5c977
4
- data.tar.gz: a62ecd054dc312d9b5cbafb407e5ab9ceabc993e96aa0974338017ddd6130765
3
+ metadata.gz: '08e96e13fd2d839ef21fe20a67581a2161dd8825c149b2bb80efe54d54959bcd'
4
+ data.tar.gz: 222511857b104fd291dad33908fd13e8cac2bdd06bc2749cf9b371b8a4135254
5
5
  SHA512:
6
- metadata.gz: bea6670b76b06244805e08acfbd70919e7753ba3526c0d9ed5f7d8d72384578512e6aaae239e34722fb9182d6c4987a7320d6fb5823fc204c771d48e452e0bbd
7
- data.tar.gz: c56169b1c22a30ce947055fc89216144ac2e9bd394287feb6de4330f63a7432c1504a5c717d0830f362f4a9dec49075baeb9041ab13c3054b8283f2b36d9e85a
6
+ metadata.gz: 1ffb3cdf601e41899cc4a6db61689552a465d5788203eb50dd8f177d56efc2ecc9c19a6537f3708f94371cb9b31c51f514263092c7cc8edb5a4448b5810feae1
7
+ data.tar.gz: fa6ce4d6919ccb971de6296a21b79fb61a0509e04fefbaaca4c823c6d3ac60ddd1a6eb165d639a6f89dab2cb9a542168ed2e9939415e75c4615fcd8f35a1fb1f
data/CHANGELOG.md CHANGED
@@ -8,3 +8,9 @@ Also, keeps compatibility with pronto versions prior to 0.11.2.
8
8
  ### New features
9
9
 
10
10
  - Create AnnotationsFormatter class and change FORMATTERS const to include the new format
11
+
12
+ ## 0.2.0
13
+
14
+ ### Changes
15
+
16
+ - Use the new `registry` method to include annotations formatter and remove the monkeypatch
data/README.md CHANGED
@@ -32,6 +32,11 @@ Or install it yourself as:
32
32
  gem install pronto-annotations_formatter
33
33
  ```
34
34
 
35
+ > [!NOTE]
36
+ >
37
+ > If you are using pronto `<= v0.11.1`, please use
38
+ > [v0.1](https://github.com/emilio2hd/pronto-annotations_formatter/releases/tag/v0.1.0)
39
+
35
40
  ## Usage
36
41
 
37
42
  ```shell
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Pronto
4
4
  module AnnotationsFormatter
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "pronto/formatter/formatter"
3
4
  require "pronto/formatter/base"
4
5
 
5
6
  require_relative "annotations_formatter/version"
@@ -7,6 +8,10 @@ require_relative "annotations_formatter/version"
7
8
  module Pronto
8
9
  module Formatter
9
10
  class AnnotationsFormatter < Pronto::Formatter::Base
11
+ def self.name
12
+ "annotations"
13
+ end
14
+
10
15
  # {
11
16
  # "message": "Some message",
12
17
  # "level": "warning",
@@ -46,28 +51,6 @@ module Pronto
46
51
  end
47
52
  end
48
53
  end
49
-
50
- module AnnotationsFormatterMonkeypatch
51
- ANNOTATION_OPTION = "annotations"
52
- ORIGINAL_FORMATTERS = {}.freeze
53
-
54
- # Get Pronto::Formatter::FORMATTERS constant and set a new one, adding the annotations leading to new formatter.
55
- # As FORMATTERS is a frozen hash, it's required remove it and set a new one with the new option.
56
- def self.apply_patch
57
- return unless Pronto::Formatter.const_defined?(:FORMATTERS)
58
- return if Pronto::Formatter::FORMATTERS.keys.include?(ANNOTATION_OPTION)
59
-
60
- formatters_const = Pronto::Formatter.const_get(:FORMATTERS)
61
- Pronto::Formatter.send(:remove_const, :FORMATTERS)
62
-
63
- send(:remove_const, :ORIGINAL_FORMATTERS)
64
- const_set(:ORIGINAL_FORMATTERS, formatters_const)
65
- Pronto::Formatter.const_set(
66
- :FORMATTERS,
67
- formatters_const.merge(ANNOTATION_OPTION => Pronto::Formatter::AnnotationsFormatter).freeze
68
- )
69
- end
70
-
71
- apply_patch
72
- end
73
54
  end
55
+
56
+ Pronto::Formatter.register(Pronto::Formatter::AnnotationsFormatter)
metadata CHANGED
@@ -1,23 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-annotations_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emilio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-31 00:00:00.000000000 Z
11
+ date: 2023-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pronto
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 0.5.0
20
- - - "<"
21
18
  - !ruby/object:Gem::Version
22
19
  version: 0.11.2
23
20
  type: :runtime
@@ -25,9 +22,6 @@ dependencies:
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 0.5.0
30
- - - "<"
31
25
  - !ruby/object:Gem::Version
32
26
  version: 0.11.2
33
27
  description: |2