pericope 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -48,10 +48,14 @@ It recognizes common abbreviations and misspellings for names of the books of th
48
48
 
49
49
  # History
50
50
 
51
+ # 0.6.1
52
+
53
+ - Deprecated the `report` and `extract` methods (they will be removed in 0.7.0)
54
+
51
55
  # 0.6.0
52
56
 
53
57
  - Removed the `index` attribute
54
- - Deprecated the `pattern` argument to the method `Pericope.split(text, pattern=nil)`
58
+ - Deprecated the `pattern` argument to the method `Pericope.split(text, pattern=nil)` (it will be removed in 0.7.0)
55
59
  - Improved performance by 2x
56
60
  - Added this README
57
61
  - Fixed a bug with parsing inverted [invalid] ranges (e.g. Mark 3-1)
@@ -126,6 +126,7 @@ class Pericope
126
126
 
127
127
 
128
128
  def self.extract(text)
129
+ puts "DEPRECATION NOTICE: the 'extract' method will be removed in Pericope 0.7.0"
129
130
  segments = split(text)
130
131
  text = ""
131
132
  pericopes = []
@@ -170,6 +171,7 @@ class Pericope
170
171
 
171
172
 
172
173
  def report
174
+ puts "DEPRECATION NOTICE: the 'report' method will be removed in Pericope 0.7.0"
173
175
  " #{self.original_string} => #{self}"
174
176
  end
175
177
 
@@ -405,14 +407,12 @@ private
405
407
 
406
408
  def self.parse_reference(book, reference)
407
409
  reference = normalize_reference(reference)
408
- (reference.nil? || reference.empty?) ? [] : parse_ranges(book, reference.split(/[,;]/))
410
+ parse_ranges(book, reference.split(/[,;]/))
409
411
  end
410
412
 
411
413
  def self.normalize_reference(reference)
412
- [ [%r{(\d+)[".](\d+)},'\1:\2'], # 12"5 and 12.5 -> 12:5
413
- [%r{(–|—)},'-'], # convert em dash and en dash to -
414
- [%r{[^0-9,:;\-–—]},''] # remove everything but [0-9,;:-]
415
- ].each { |pattern, replacement| reference.gsub!(pattern, replacement) }
414
+ reference = reference.to_s
415
+ NORMALIZATIONS.each { |(regex, replacement)| reference.gsub!(regex, replacement) }
416
416
  reference
417
417
  end
418
418
 
@@ -594,6 +594,12 @@ private
594
594
 
595
595
  PERICOPE_PATTERN = /(#{BOOK_PATTERN})\.? (#{REFERENCE_PATTERN})/i
596
596
 
597
+ NORMALIZATIONS = [
598
+ [/(\d+)[".](\d+)/, '\1:\2'], # 12"5 and 12.5 -> 12:5
599
+ [/[–—]/, '-'], # convert em dash and en dash to -
600
+ [/[^0-9,:;\-–—]/, ''] # remove everything but [0-9,;:-]
601
+ ]
602
+
597
603
 
598
604
 
599
605
  end
@@ -1,3 +1,3 @@
1
1
  class Pericope
2
- VERSION = "0.6.0" unless defined?(::Pericope::Version)
2
+ VERSION = "0.6.1" unless defined?(::Pericope::Version)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pericope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: