orthotypo 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +18 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +12 -6
- data/lib/orthotypo/composer.rb +6 -5
- data/lib/orthotypo/version.rb +1 -1
- data/lib/orthotypo.rb +1 -0
- data/orthotypo.gemspec +1 -0
- data/spec/composer/fr_spec.rb +8 -0
- data/spec/spec_helper.rb +1 -1
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b39450aef34318976f5708d105828cbc0792ff8d6c81a1f3c3eb51d2ce27713b
|
4
|
+
data.tar.gz: d2a701e7525d6babcf406c702fc1e181ecae671840344df66f0d3d02538a702a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8066e337bf64b472bf9610e5e96c41819c5e0148a8725d22781c3d26a987835cc098745f8f12de4d3f087d745186006f6fe11f8fd7daa64e870d0175e458f3f6
|
7
|
+
data.tar.gz: b9d9e4398cbc8e7516f6eb475abc0a22ae291b12b38706ed08bbc18e568abb415da8ec45ed7a6a3658a911efe68df0b6d15b0950b1f007d108dadf6de5ab1e0d
|
@@ -0,0 +1,18 @@
|
|
1
|
+
version: 2.1
|
2
|
+
orbs:
|
3
|
+
ruby: circleci/ruby@2.1.1
|
4
|
+
jobs:
|
5
|
+
test:
|
6
|
+
docker:
|
7
|
+
- image: cimg/ruby:3.3
|
8
|
+
steps:
|
9
|
+
- checkout
|
10
|
+
- ruby/install-deps
|
11
|
+
- run:
|
12
|
+
name: Run tests
|
13
|
+
command: bundle exec rake
|
14
|
+
workflows:
|
15
|
+
version: 2
|
16
|
+
deploy:
|
17
|
+
jobs:
|
18
|
+
- test
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
orthotypo (1.0.
|
4
|
+
orthotypo (1.0.4)
|
5
5
|
htmlentities
|
6
6
|
nokogiri
|
7
7
|
|
@@ -18,6 +18,8 @@ GEM
|
|
18
18
|
racc (~> 1.4)
|
19
19
|
nokogiri (1.16.2-x86_64-darwin)
|
20
20
|
racc (~> 1.4)
|
21
|
+
nokogiri (1.16.2-x86_64-linux)
|
22
|
+
racc (~> 1.4)
|
21
23
|
parallel (1.24.0)
|
22
24
|
parser (3.3.0.5)
|
23
25
|
ast (~> 2.4.1)
|
@@ -42,8 +44,10 @@ GEM
|
|
42
44
|
rspec-nc (0.3.0)
|
43
45
|
rspec (>= 3)
|
44
46
|
terminal-notifier (>= 1.4)
|
45
|
-
rspec-support (3.13.
|
46
|
-
|
47
|
+
rspec-support (3.13.1)
|
48
|
+
rspec_junit_formatter (0.6.0)
|
49
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
50
|
+
rubocop (1.62.1)
|
47
51
|
json (~> 2.3)
|
48
52
|
language_server-protocol (>= 3.17.0)
|
49
53
|
parallel (~> 1.10)
|
@@ -51,11 +55,11 @@ GEM
|
|
51
55
|
rainbow (>= 2.2.2, < 4.0)
|
52
56
|
regexp_parser (>= 1.8, < 3.0)
|
53
57
|
rexml (>= 3.2.5, < 4.0)
|
54
|
-
rubocop-ast (>= 1.
|
58
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
55
59
|
ruby-progressbar (~> 1.7)
|
56
60
|
unicode-display_width (>= 2.4.0, < 3.0)
|
57
|
-
rubocop-ast (1.
|
58
|
-
parser (>= 3.
|
61
|
+
rubocop-ast (1.31.2)
|
62
|
+
parser (>= 3.3.0.4)
|
59
63
|
ruby-progressbar (1.13.0)
|
60
64
|
terminal-notifier (2.0.0)
|
61
65
|
unicode-display_width (2.5.0)
|
@@ -64,6 +68,7 @@ PLATFORMS
|
|
64
68
|
arm64-darwin-22
|
65
69
|
arm64-darwin-23
|
66
70
|
x86_64-darwin-22
|
71
|
+
x86_64-linux
|
67
72
|
|
68
73
|
DEPENDENCIES
|
69
74
|
byebug
|
@@ -71,6 +76,7 @@ DEPENDENCIES
|
|
71
76
|
rake (~> 13.0)
|
72
77
|
rspec
|
73
78
|
rspec-nc
|
79
|
+
rspec_junit_formatter
|
74
80
|
rubocop (~> 1.21)
|
75
81
|
|
76
82
|
BUNDLED WITH
|
data/lib/orthotypo/composer.rb
CHANGED
@@ -114,7 +114,7 @@ module Orthotypo
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def preserve_precious_things
|
117
|
-
@precious_things =
|
117
|
+
@precious_things = {}
|
118
118
|
@nokogiri.traverse do |node|
|
119
119
|
if node.text?
|
120
120
|
has_leading_space = node.content.start_with? SPACE
|
@@ -143,16 +143,17 @@ module Orthotypo
|
|
143
143
|
|
144
144
|
def store_precious_thing(string)
|
145
145
|
# Create token identifier
|
146
|
-
|
146
|
+
uid = SecureRandom.hex
|
147
|
+
token = "#{PRECIOUS_TOKEN}-#{uid}"
|
147
148
|
# Store value
|
148
|
-
@precious_things
|
149
|
+
@precious_things[uid] = string
|
149
150
|
# Return identifier
|
150
151
|
token
|
151
152
|
end
|
152
153
|
|
153
154
|
def restore_precious_things
|
154
|
-
@precious_things.
|
155
|
-
@ortho.gsub! "#{PRECIOUS_TOKEN}
|
155
|
+
@precious_things.each do |uid, value|
|
156
|
+
@ortho.gsub! "#{PRECIOUS_TOKEN}-#{uid}", value
|
156
157
|
end
|
157
158
|
end
|
158
159
|
|
data/lib/orthotypo/version.rb
CHANGED
data/lib/orthotypo.rb
CHANGED
data/orthotypo.gemspec
CHANGED
data/spec/composer/fr_spec.rb
CHANGED
@@ -97,4 +97,12 @@ describe Orthotypo::Composer::Fr do
|
|
97
97
|
# expect("Il en compte 1,000, 10,000, 36,742, 500,000, puis 1,000,000, 25,000,000, etc.".ortho).to(eq("Il en compte 1 000, 10 000, 36 742, 500 000, puis 1 000 000, 25 000 000, etc."))
|
98
98
|
# expect("Le numéro gagnant est le 3 541 672.".ortho).to(eq("Le numéro gagnant est le 3541672."))
|
99
99
|
end
|
100
|
+
|
101
|
+
it 'preserves all URLs' do
|
102
|
+
# Generates '<a href="https://example0.fr\">Example 0</a><a href="https://example1.fr\">Example 1</a><a href="https://example2.fr\">Example 2</a>...'
|
103
|
+
input = (0..12).map { |n|
|
104
|
+
"<a href=\"https://example#{n}.fr\">Example #{n}</a>"
|
105
|
+
}.join
|
106
|
+
expect(input.ortho).to(eq(input))
|
107
|
+
end
|
100
108
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require 'byebug'
|
2
|
-
require '
|
2
|
+
require 'orthotypo'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orthotypo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnaud Levy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec_junit_formatter
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: byebug
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,6 +103,7 @@ executables: []
|
|
89
103
|
extensions: []
|
90
104
|
extra_rdoc_files: []
|
91
105
|
files:
|
106
|
+
- ".circleci/config.yml"
|
92
107
|
- ".gitignore"
|
93
108
|
- ".rubocop.yml"
|
94
109
|
- CHANGELOG.md
|
@@ -140,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
155
|
- !ruby/object:Gem::Version
|
141
156
|
version: '0'
|
142
157
|
requirements: []
|
143
|
-
rubygems_version: 3.
|
158
|
+
rubygems_version: 3.4.10
|
144
159
|
signing_key:
|
145
160
|
specification_version: 4
|
146
161
|
summary: Pour un texte correctement typographié
|