pronto-annotations_formatter 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +5 -0
- data/lib/pronto/annotations_formatter/version.rb +1 -1
- data/lib/pronto/annotations_formatter.rb +7 -24
- metadata +2 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08e96e13fd2d839ef21fe20a67581a2161dd8825c149b2bb80efe54d54959bcd'
|
4
|
+
data.tar.gz: 222511857b104fd291dad33908fd13e8cac2bdd06bc2749cf9b371b8a4135254
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -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.
|
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-
|
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
|