text-gen 0.4.0 → 0.4.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 +4 -4
- data/lib/text/gen/result_accumulator.rb +2 -2
- data/lib/text/gen/runner.rb +3 -1
- data/lib/text/gen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a407f025ce7e1835fe342ecdd09831a83fc8384c3e5bf5cebe9d63b7c9105689
|
|
4
|
+
data.tar.gz: '08254c7fc3f59de3c959d34f469813a1af7ca2114c0678641c38093e67ddc421'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5faa23b1eb072b7f559269dea94a4e93096296ea8d6a197d86f3ea038b2f6d37d513afb18070174a7508f6119281e1f7f584893816b56515259287e25c32a428
|
|
7
|
+
data.tar.gz: dfec5829429cd2f2bba0f709bda7b0fd7b3402f181336755c7c05768ef79e57e41c77d4d181de070409b4be5030fc36b654e3269a055752385a54f3f9cac32bf
|
|
@@ -12,8 +12,8 @@ module Text
|
|
|
12
12
|
|
|
13
13
|
def initialize(unique:, count:, max_attempts:)
|
|
14
14
|
@unique = unique
|
|
15
|
-
@count = count
|
|
16
|
-
@max_attempts = max_attempts
|
|
15
|
+
@count = [count, 1].max
|
|
16
|
+
@max_attempts = [max_attempts, 1].max
|
|
17
17
|
@results = unique ? {} : []
|
|
18
18
|
@attempts = max_attempts * count
|
|
19
19
|
end
|
data/lib/text/gen/runner.rb
CHANGED
|
@@ -111,8 +111,10 @@ module Text
|
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
def run_item(item, depth)
|
|
114
|
+
return unless item
|
|
115
|
+
|
|
114
116
|
locale_item = Filter.replace_locale(item, locale)
|
|
115
|
-
item = locale_item
|
|
117
|
+
item = locale_item || item
|
|
116
118
|
|
|
117
119
|
results = item["segments"].map { |seg| run_segment(seg, depth) }
|
|
118
120
|
result = Result.merge(results,
|
data/lib/text/gen/version.rb
CHANGED