pericope 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8387ffedaf83411b0b4f4741beb4cdf48fd9e21e
4
- data.tar.gz: 159b2fd94a9e3c6e9ecd927645ad98c172c62d95
2
+ SHA256:
3
+ metadata.gz: 3e83923a2ccd269b6c9dc1b763c94271c317c71ce36e749c849d13efd74a073e
4
+ data.tar.gz: 601c5ecce2a6f8c58587540afee4b8314583742a6cfa7035c80affdb06393bcb
5
5
  SHA512:
6
- metadata.gz: e33ff3c564ddc4843da0c6e46f93b3f2296a29c6fb3829058a4a019ff927d8101aabb987f994530a3ebc51618a048e1a6ab9519f8d271e9eba1dcd6d62b7ab65
7
- data.tar.gz: 3ea933b14e2be8993b94bc41fe6fa3dbc05050f4548c81ed39c7432a2d68c0160d4095a5e5c1350fececf71209269d962eb70a14b614464d47b1f3aa02954f4a
6
+ metadata.gz: afbbe5aec2cc1acdd7f9e31eddf34078427da6b33ffcda72426119d6eae41352a7ad9a233e80b29d32db25a29a6a752a01c2982ecf7a59fb4dfcb32c34090196
7
+ data.tar.gz: 91c99af22016b276e1d4a645cc2ebcb2e8852653443f5f134b25b1bfc0119ecac21ff80984d7c52a2cd72b14f3f6c70374d737b7577b1cf5b7de527a902dbd62
@@ -177,6 +177,8 @@ private
177
177
  recent_chapter = 1 unless book_has_chapters?
178
178
  recent_verse = nil
179
179
 
180
+ touched_chapters = [ recent_chapter ].compact
181
+
180
182
  ranges.each_with_index.each_with_object("") do |(range, i), s|
181
183
  if i > 0
182
184
  if recent_chapter == range.begin.chapter
@@ -187,7 +189,7 @@ private
187
189
  end
188
190
 
189
191
  last_verse = Pericope.get_max_verse(book, range.end.chapter)
190
- if !always_print_verse_range && range.begin.verse == 1 && range.begin.whole? && (range.end.verse > last_verse || range.end.whole? && range.end.verse == last_verse)
192
+ if !always_print_verse_range && range.begin.verse == 1 && range.begin.whole? && (range.end.verse > last_verse || range.end.whole? && range.end.verse == last_verse) && (touched_chapters - [range.begin.chapter]).none?
191
193
  s << range.begin.chapter.to_s
192
194
  s << "#{chapter_range_separator}#{range.end.chapter}" if range.end.chapter > range.begin.chapter
193
195
  else
@@ -207,6 +209,7 @@ private
207
209
 
208
210
  recent_chapter = range.end.chapter
209
211
  recent_verse = range.end.verse if range.end.partial?
212
+ touched_chapters |= [range.begin.chapter, range.end.chapter].uniq
210
213
  end
211
214
  end
212
215
  end
@@ -1,3 +1,3 @@
1
1
  class Pericope
2
- VERSION = "1.0.2" unless defined?(::Pericope::Version)
2
+ VERSION = "1.0.3" unless defined?(::Pericope::Version)
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pericope
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Lail
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-13 00:00:00.000000000 Z
11
+ date: 2019-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  requirements: []
153
153
  rubyforge_project:
154
- rubygems_version: 2.6.11
154
+ rubygems_version: 2.7.6
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Pericope is a gem for parsing Bible references.