bible_parser 1.1.0 → 1.1.2

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: 303f4b032cdffa6028a7a23be365cdb0e9db69565340758c74e3ac42b45b12b3
4
- data.tar.gz: 2366b6b3f08eb0ecfcaeebd06f2bf9cf9d5975360515c5b17d6b141e4b8b6427
3
+ metadata.gz: b93f1478453d5f5ab023e5baa1e3b8cec47c84f573565cb54d56720a1eb9a68e
4
+ data.tar.gz: b8cf28305651e81ffde67eb66fe8bdb0ca5323c152ca13654cdf5b565a6da757
5
5
  SHA512:
6
- metadata.gz: c0feb3be0d7eb1f36859cc62ddfac585e90fd158b1e7151e55b6445f779a519e8514de60fe869bebe2e424b65a08e1d52f5e2e4d40fb7d49d1a1d030b554d3c9
7
- data.tar.gz: 58f73c55c3d700f1cbac8cda5bd5f8c8e61eb16524953c18d4ed37313d7a2ba47de9367a1cf71e6492c1dc3795799d9f8e9d55a4599150e0096ae56b3ec9a029
6
+ metadata.gz: d77b81710e51ebf2ccfc458dfe3e83a8d638fb7aab482c0c0fc98d86805f8d8ed307733f3b0c48398df88a76c289b158d3bc35b32ba93be4efff569038daa299
7
+ data.tar.gz: 1cecf61c6d06201abe67c0471bd1943900b7fb6705c6747b0e4a82596cb2f29f5ae2261a656a255cd56a8d4c09b6c2d7534c2124348a6c22ce73eec2f1b803b4
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # BibleParser
2
2
 
3
- [![Build Status](https://travis-ci.org/seven1m/bible_parser.svg?branch=master)](https://travis-ci.org/seven1m/bible_parser)
3
+ [![Build](https://github.com/seven1m/bible_parser/actions/workflows/specs.yml/badge.svg)](https://github.com/seven1m/bible_parser/actions/workflows/specs.yml)
4
4
 
5
5
  This is a Ruby library for parsing different bible XML formats.
6
6
 
@@ -59,7 +59,6 @@ class BibleParser
59
59
  '1Esd' => '1ES',
60
60
  '2Esd' => '2ES',
61
61
  'PrMan' => 'MAN',
62
- '2Esd' => 'PS2',
63
62
  'Matt' => 'MAT',
64
63
  'Mark' => 'MRK',
65
64
  'Luke' => 'LUK',
@@ -11,6 +11,8 @@ class BibleParser
11
11
  when 'div'
12
12
  end_verse if @mode == 'verse'
13
13
  start_book(attributes)
14
+ when 'milestone'
15
+ set_book_title_from_milestone(attributes)
14
16
  when 'title'
15
17
  set_book_title(attributes)
16
18
  when 'chapter'
@@ -19,6 +21,8 @@ class BibleParser
19
21
  when 'verse'
20
22
  end_verse if @mode == 'verse'
21
23
  start_verse(attributes)
24
+ when 'note'
25
+ start_footnote(attributes)
22
26
  end
23
27
  end
24
28
 
@@ -29,6 +33,8 @@ class BibleParser
29
33
  end_book
30
34
  @book_id = nil
31
35
  end
36
+ when 'note'
37
+ @mode = 'verse'
32
38
  end
33
39
  end
34
40
 
@@ -43,11 +49,17 @@ class BibleParser
43
49
  end
44
50
 
45
51
  def set_book_title(attributes)
52
+ return if @book_title
46
53
  attributes = Hash[attributes]
47
54
  return unless attributes['type'] == 'main'
48
55
  @book_title = attributes['short']
49
56
  end
50
57
 
58
+ def set_book_title_from_milestone(attributes)
59
+ attributes = Hash[attributes]
60
+ @book_title = attributes['n']
61
+ end
62
+
51
63
  def end_book_title
52
64
  @mode = nil
53
65
  end
@@ -69,6 +81,15 @@ class BibleParser
69
81
  @mode = 'verse'
70
82
  end
71
83
 
84
+ # Properly parse footnotes out of the text that shows up within a verse
85
+ def start_footnote(attributes)
86
+ @mode = 'note'
87
+ end
88
+
89
+ def end_footnote(attributes)
90
+ @mode = 'verse'
91
+ end
92
+
72
93
  def characters(string)
73
94
  case @mode
74
95
  when 'verse'
@@ -10,10 +10,12 @@ class BibleParser
10
10
  def start_element(name, attributes)
11
11
  case name
12
12
  when 'book'
13
+ end_verse if @mode == 'verse'
13
14
  start_book(attributes)
14
15
  when 'h'
15
16
  start_book_title(attributes)
16
17
  when 'c'
18
+ end_verse if @mode == 'verse'
17
19
  start_chapter(attributes)
18
20
  when 'v'
19
21
  end_verse if @mode == 'verse'
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.0
4
+ version: 1.1.2
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: 2021-07-11 00:00:00.000000000 Z
11
+ date: 2024-03-02 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.0.3
101
- signing_key:
100
+ rubygems_version: 3.5.3
101
+ signing_key:
102
102
  specification_version: 4
103
103
  summary: Library for parsing the bible in various formats
104
104
  test_files: []