bomdb 0.2.1 → 0.2.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 +4 -4
- data/README.md +69 -0
- data/lib/bomdb/export/contents.rb +1 -1
- data/lib/bomdb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 033e279990a8a889f27f0cfd0569d3e76e9345aa
|
4
|
+
data.tar.gz: f8a5d832f7398bd0caeb5669785dd337519baa41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ae1472a90909e6c194662317bd0d284a9cad4fdf30c5148ed7200f3623d9cdc0085292cc47751fc17f1a2c6099f443ee42f083617f464c469d3017c1e34be1e
|
7
|
+
data.tar.gz: f832dd8e4625497a14985f9a9e2f684a9ca5025c201d869ac48093ac75cbb96b86eb9f1e21eb532e0e5ba6328c41fa6c70632bad14f1f9afb1cfde7f251fdf29
|
data/README.md
CHANGED
@@ -41,6 +41,75 @@ $ bomdb show 1829 --exclude Bible-OT
|
|
41
41
|
# ... shows 6080 verses instead of the usual 6604
|
42
42
|
```
|
43
43
|
|
44
|
+
|
45
|
+
### IMPORT and EXPORT portions of the database
|
46
|
+
|
47
|
+
You can import and export any part of the database, such as the books, verses, editions, and contents (text) of the database.
|
48
|
+
|
49
|
+
The github repository contains a set of "starter" json file that are used to seed the database with some reasonable structure and data; however, these json files are absent in the packaged Gem. If you've cloned the github repo, you can re-create the database from scratch:
|
50
|
+
|
51
|
+
```bash
|
52
|
+
$ bundle exec bin/bomdb create
|
53
|
+
Database file 'bomdb/data/book_of_mormon.db' exists. Delete? (y/N)
|
54
|
+
y
|
55
|
+
Created the following tables:
|
56
|
+
books
|
57
|
+
verses
|
58
|
+
editions
|
59
|
+
contents
|
60
|
+
refs
|
61
|
+
notes
|
62
|
+
Importing books...
|
63
|
+
Success
|
64
|
+
Importing verses...
|
65
|
+
Success
|
66
|
+
Importing editions...
|
67
|
+
Success
|
68
|
+
Importing contents...
|
69
|
+
Success
|
70
|
+
Importing refs...
|
71
|
+
Success
|
72
|
+
Done.
|
73
|
+
```
|
74
|
+
|
75
|
+
If you have an edition of the Book of Mormon in JSON format that is not present in the database, you can import it, like so:
|
76
|
+
|
77
|
+
```bash
|
78
|
+
$ bomdb import bom-1857.json --type=contents
|
79
|
+
```
|
80
|
+
|
81
|
+
(See the bomdb/data/contents.json file for an example of the expected JSON format)
|
82
|
+
|
83
|
+
You can export specific editions in JSON format like so:
|
84
|
+
|
85
|
+
```bash
|
86
|
+
$ bomdb export contents --editions=1829,1830
|
87
|
+
```
|
88
|
+
|
89
|
+
or as text:
|
90
|
+
|
91
|
+
```bash
|
92
|
+
$ bomdb export contents --editions=1829,1830 --format=text
|
93
|
+
```
|
94
|
+
|
95
|
+
(Omit `--editions` altogether and you will get an export of ALL editions.)
|
96
|
+
|
97
|
+
|
98
|
+
### List REFERENCES to Biblical (or other) texts
|
99
|
+
|
100
|
+
```bash
|
101
|
+
$ bomdb references
|
102
|
+
Bible-NT (2 refs)
|
103
|
+
Bible-OT (594 refs)
|
104
|
+
```
|
105
|
+
|
106
|
+
```bash
|
107
|
+
$bomdb references Bible-NT
|
108
|
+
1 Corinthians 15:32
|
109
|
+
Luke 12:19
|
110
|
+
```
|
111
|
+
|
112
|
+
|
44
113
|
### ALIGN a new Book of Mormon text file
|
45
114
|
|
46
115
|
Suppose you have a new Book of Mormon text file that has been scanned from OCR or otherwise entered as a text file. It would take a lot of work to manually align all 6604 verses with the "standard" book, chapter, and verse numbers. Instead, BomDB helps automate this process:
|
@@ -64,7 +64,7 @@ module BomDB
|
|
64
64
|
else
|
65
65
|
# export editions that are mentioned by name-prefix
|
66
66
|
ed_model = Models::Edition.new(@db)
|
67
|
-
opts[:edition_prefixes].each do |epat|
|
67
|
+
opts[:edition_prefixes].split(/\s*,\s*/).each do |epat|
|
68
68
|
e = ed_model.find(epat)
|
69
69
|
editions_by_id[ e[:edition_id] ] = e
|
70
70
|
end
|
data/lib/bomdb/version.rb
CHANGED