coradoc 2.0.20 → 2.0.21
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 +4 -4
- data/lib/coradoc/core_model/raw_inline_element.rb +16 -0
- data/lib/coradoc/core_model.rb +1 -0
- data/lib/coradoc/performance_regression.rb +19 -7
- data/lib/coradoc/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a4ebd4f989cb1c3bc9c6adcede592e91c6013a29bf94c3d12319e03c5c42ab38
|
|
4
|
+
data.tar.gz: d321f36297bb31aac76fe30a6195aa9cd1456c840dfb1888405c0e36f474c4b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1bba8d765b1af164d1713f16013eddbdbc906340f37d1918777fd3ec1c6f1ec784e869155ccae100b6d4a4306bea003c4031fbf6276890608471a97d5a407bd2
|
|
7
|
+
data.tar.gz: e76a4e152ebbc25ee03732c6870fbfbdf062d8a3e0af8423b4da9486d14483952a56a3af6b25c256a6350e60e475afa89112e25931b08b47209884ceb1e8089a
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Coradoc
|
|
4
|
+
module CoreModel
|
|
5
|
+
# Inline raw passthrough — content the source format marked as "do not
|
|
6
|
+
# process". AsciiDoc's `+++raw+++` is the canonical producer. Spokes
|
|
7
|
+
# that lack a passthrough concept (most of them) should emit the
|
|
8
|
+
# content verbatim, since the original author explicitly chose raw
|
|
9
|
+
# markup (often HTML) knowing it would be passed through.
|
|
10
|
+
class RawInlineElement < InlineElement
|
|
11
|
+
def self.format_type
|
|
12
|
+
'raw_inline'
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
data/lib/coradoc/core_model.rb
CHANGED
|
@@ -36,6 +36,7 @@ module Coradoc
|
|
|
36
36
|
autoload :SpanElement, "#{__dir__}/core_model/inline_element"
|
|
37
37
|
autoload :TermElement, "#{__dir__}/core_model/inline_element"
|
|
38
38
|
autoload :LineBreakElement, "#{__dir__}/core_model/inline_element"
|
|
39
|
+
autoload :RawInlineElement, "#{__dir__}/core_model/raw_inline_element"
|
|
39
40
|
autoload :StructuralElement, "#{__dir__}/core_model/structural_element"
|
|
40
41
|
autoload :DocumentElement, "#{__dir__}/core_model/structural_element"
|
|
41
42
|
autoload :SectionElement, "#{__dir__}/core_model/structural_element"
|
|
@@ -23,6 +23,11 @@ module Coradoc
|
|
|
23
23
|
def passed?
|
|
24
24
|
duration < threshold
|
|
25
25
|
end
|
|
26
|
+
|
|
27
|
+
def format_line
|
|
28
|
+
status = passed? ? 'PASS' : 'FAIL'
|
|
29
|
+
" #{status} #{name}: #{duration.round(4)}s (threshold: #{threshold}s)"
|
|
30
|
+
end
|
|
26
31
|
end
|
|
27
32
|
|
|
28
33
|
ComparisonResult = Struct.new(:name, :duration, :baseline, keyword_init: true) do
|
|
@@ -31,6 +36,12 @@ module Coradoc
|
|
|
31
36
|
|
|
32
37
|
(duration - baseline).abs / baseline > pct
|
|
33
38
|
end
|
|
39
|
+
|
|
40
|
+
def format_line
|
|
41
|
+
status = regressed? ? 'WARN' : 'OK'
|
|
42
|
+
baseline_str = baseline ? "(baseline: #{baseline.round(4)}s)" : '(no baseline)'
|
|
43
|
+
" #{status} #{name}: #{duration.round(4)}s #{baseline_str}"
|
|
44
|
+
end
|
|
34
45
|
end
|
|
35
46
|
|
|
36
47
|
class << self
|
|
@@ -50,14 +61,15 @@ module Coradoc
|
|
|
50
61
|
{ results:, failed_count: failed, total: results.size }
|
|
51
62
|
end
|
|
52
63
|
|
|
53
|
-
def print_results(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
puts
|
|
64
|
+
def print_results(summary_or_results)
|
|
65
|
+
if summary_or_results.is_a?(Hash)
|
|
66
|
+
summary = summary_or_results
|
|
67
|
+
summary[:results].each { |r| puts r.format_line }
|
|
68
|
+
puts
|
|
69
|
+
puts "#{summary[:total] - summary[:failed_count]}/#{summary[:total]} passed"
|
|
70
|
+
else
|
|
71
|
+
Array(summary_or_results).each { |r| puts r.format_line }
|
|
58
72
|
end
|
|
59
|
-
puts
|
|
60
|
-
puts "#{summary[:total] - summary[:failed_count]}/#{summary[:total]} passed"
|
|
61
73
|
end
|
|
62
74
|
|
|
63
75
|
def compare_with_baseline(baseline_path, iterations: 3)
|
data/lib/coradoc/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: coradoc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.21
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -88,6 +88,7 @@ files:
|
|
|
88
88
|
- lib/coradoc/core_model/paragraph_block.rb
|
|
89
89
|
- lib/coradoc/core_model/pass_block.rb
|
|
90
90
|
- lib/coradoc/core_model/quote_block.rb
|
|
91
|
+
- lib/coradoc/core_model/raw_inline_element.rb
|
|
91
92
|
- lib/coradoc/core_model/reviewer_block.rb
|
|
92
93
|
- lib/coradoc/core_model/sidebar_block.rb
|
|
93
94
|
- lib/coradoc/core_model/source_block.rb
|