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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e32773381d2c8aa30b9c027bf9c5a00f4b76045eff5e6fd36626d94fa33de652
4
- data.tar.gz: 97e3c3b49b367939e270582fb3c6b2e940d623bfec93fab341af27fe1e3902d6
3
+ metadata.gz: a407f025ce7e1835fe342ecdd09831a83fc8384c3e5bf5cebe9d63b7c9105689
4
+ data.tar.gz: '08254c7fc3f59de3c959d34f469813a1af7ca2114c0678641c38093e67ddc421'
5
5
  SHA512:
6
- metadata.gz: 68f26c344a0feb1b1a730d9247e41c8dc93e27f1a52f22f7d16bdb0c1d719ba3ff03b294475f36e1c404c816192a995c9c3341ff845af0b29d6ad0a37e0e5028
7
- data.tar.gz: 3021702f504892d11d449c2de96ad98d5b5b1d7d514f4bc8f32e91b172e74383a3338faf1256fc03c57dcba34fb6442ccc560ad004e7ddc948c2e709562ce684
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
@@ -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 if 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,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Text
4
4
  module Gen
5
- VERSION = "0.4.0"
5
+ VERSION = "0.4.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - G Palmer