bible_parser 1.1.2 → 1.1.3

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: b93f1478453d5f5ab023e5baa1e3b8cec47c84f573565cb54d56720a1eb9a68e
4
- data.tar.gz: b8cf28305651e81ffde67eb66fe8bdb0ca5323c152ca13654cdf5b565a6da757
3
+ metadata.gz: 2589fc1c1a0faff54fd9550a3c474623d74ad32f4cdffe70815ff744a9696a77
4
+ data.tar.gz: 070ed35e7e8f41c11f0667892456b4038877ff815a8e09345df8d180a04f4797
5
5
  SHA512:
6
- metadata.gz: d77b81710e51ebf2ccfc458dfe3e83a8d638fb7aab482c0c0fc98d86805f8d8ed307733f3b0c48398df88a76c289b158d3bc35b32ba93be4efff569038daa299
7
- data.tar.gz: 1cecf61c6d06201abe67c0471bd1943900b7fb6705c6747b0e4a82596cb2f29f5ae2261a656a255cd56a8d4c09b6c2d7534c2124348a6c22ce73eec2f1b803b4
6
+ metadata.gz: d6d140484f8e1a989205775edd2fbd04cc5f54d8682ce84925331e8b7e219be65278e2e7b174d03d746910f34a2bfb276331aa9061f968011993404d2cd69cb0
7
+ data.tar.gz: d2ef4c8130bbaf1d38892666210c8286c82b0608ee48dc1e506f25080d8649c5c3c1f60611f04f640caa5f0e87c35f5bb82c2d0dd30341a431637973e5d072fd
@@ -33,6 +33,10 @@ class BibleParser
33
33
  end_book
34
34
  @book_id = nil
35
35
  end
36
+ when 'verse'
37
+ end_verse if @mode == 'verse' && @wrapping_verse
38
+ when 'chapter'
39
+ end_chapter if @wrapping_chapter
36
40
  when 'note'
37
41
  @mode = 'verse'
38
42
  end
@@ -45,11 +49,10 @@ class BibleParser
45
49
  @book_num += 1
46
50
  @book_id = BOOK_IDS[id] || id.upcase[0..2]
47
51
  @mode = 'book'
48
- @book_title = nil
52
+ @book_title = id
49
53
  end
50
54
 
51
55
  def set_book_title(attributes)
52
- return if @book_title
53
56
  attributes = Hash[attributes]
54
57
  return unless attributes['type'] == 'main'
55
58
  @book_title = attributes['short']
@@ -68,6 +71,10 @@ class BibleParser
68
71
  attributes = Hash[attributes]
69
72
  if attributes['sID']
70
73
  @chapter = attributes['n'].to_i
74
+ @wrapping_chapter = false
75
+ elsif attributes['osisID']
76
+ @chapter = attributes['osisID'].split('.').last.to_i
77
+ @wrapping_chapter = true
71
78
  else
72
79
  end_chapter
73
80
  end
@@ -75,8 +82,15 @@ class BibleParser
75
82
 
76
83
  def start_verse(attributes)
77
84
  attributes = Hash[attributes]
78
- return unless attributes['sID']
79
- @verse = attributes['n'].to_i
85
+ if attributes['sID']
86
+ @verse = attributes['n'].to_i
87
+ @wrapping_verse = false
88
+ elsif attributes['osisID']
89
+ @verse = attributes['osisID'].split('.').last.to_i
90
+ @wrapping_verse = true
91
+ else
92
+ return
93
+ end
80
94
  @text = ''
81
95
  @mode = 'verse'
82
96
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bible_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Morgan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-02 00:00:00.000000000 Z
11
+ date: 2026-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description:
55
+ description:
56
56
  email: tim@timmorgan.org
57
57
  executables: []
58
58
  extensions: []
@@ -82,7 +82,7 @@ files:
82
82
  homepage: https://github.com/seven1m/bible_parser
83
83
  licenses: []
84
84
  metadata: {}
85
- post_install_message:
85
+ post_install_message:
86
86
  rdoc_options: []
87
87
  require_paths:
88
88
  - lib
@@ -97,8 +97,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
- rubygems_version: 3.5.3
101
- signing_key:
100
+ rubygems_version: 3.0.3.1
101
+ signing_key:
102
102
  specification_version: 4
103
103
  summary: Library for parsing the bible in various formats
104
104
  test_files: []