metanorma-utils 1.6.0 → 1.6.1

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: 3234e3bc74a4ba02f150016c23db7e9b3d03386ae9f78ac42e3a64d78e31556e
4
- data.tar.gz: 5ac7ae07a58d238b199f7e4cb9b79175e6ea0e99dfa5185358fffb579906de0f
3
+ metadata.gz: 4a36ca58dc687a7608f94df44a4f977a7571a687c196217f743af012f05e25b8
4
+ data.tar.gz: 6a3f38cf066b108a4ace75fa1946b696382963e63212567001eddabaa4a0dfe0
5
5
  SHA512:
6
- metadata.gz: fc1e64c876f4d3bafd6996bd10421c810370ca3b512f702a1a09079a49d242773c90206f68a8f1187a574f13a7fbd9c7b4ec6dd122be18b9e7d6568785483066
7
- data.tar.gz: dde8f1ea187e9cf6e9d80972c3b785c499a2c55fd6c8e9f3550e666a6b0e69ae711ba27c3e604d0c5e9f0fbe085a28ee45c240e5f969995497a5fd5b81c4aa59
6
+ metadata.gz: 98a4fce07065b0b9c03a78d140c64313608ac89bf2f05d93d09f50b196bed93dfc83c54ddcb62474fbd965f22430ad4c5fbba975eb1442796e1e478f10d9433e
7
+ data.tar.gz: 890a86a2c8c1835e7a4d0bf41cc6b1f77667150b890a1340eaf1d1a8290c8a33560a0ec111af269771fddc0bfddca66c57902c5e7ba7faf1fbbb3f8907c6c24c
data/lib/utils/main.rb CHANGED
@@ -136,10 +136,10 @@ module Metanorma
136
136
  def break_up_long_str(text, threshold = LONGSTR_THRESHOLD, nopunct = LONGSTR_NOPUNCT)
137
137
  /^\s*$/.match?(text) and return text
138
138
  text.split(/(?=\s)/).map do |w|
139
- if /^\s*$/.match(text) || (w.size < LONGSTR_THRESHOLD) then w
139
+ if /^\s*$/.match(text) || (w.size < threshold) then w
140
140
  else
141
- w.scan(/.{,#{LONGSTR_THRESHOLD}}/o).map.with_index do |w1, i|
142
- w1.size < LONGSTR_THRESHOLD ? w1 : break_up_long_str1(w1, i + 1)
141
+ w.scan(/.{,#{threshold}}/o).map.with_index do |w1, i|
142
+ w1.size < threshold ? w1 : break_up_long_str1(w1, i + 1, nopunct)
143
143
  end.join
144
144
  end
145
145
  end.join
@@ -160,10 +160,10 @@ module Metanorma
160
160
  (?<=\p{Ll}\p{Ll})(?=\p{Lu}\p{Ll}\p{Ll}) # 2 lowerc / upperc, 2 lowerc
161
161
  }x.freeze
162
162
 
163
- def break_up_long_str1(text, iteration)
163
+ def break_up_long_str1(text, iteration, nopunct)
164
164
  s, separator = break_up_long_str2(text)
165
165
  if s.size == 1 # could not break up
166
- (iteration % LONGSTR_NOPUNCT).zero? and
166
+ (iteration % nopunct).zero? and
167
167
  text += "\u00ad" # force soft hyphen
168
168
  text
169
169
  else
data/lib/utils/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Utils
3
- VERSION = "1.6.0".freeze
3
+ VERSION = "1.6.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.