bomdb 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +18 -0
- data/data/book_of_mormon.db +0 -0
- data/lib/bomdb/query.rb +6 -2
- data/lib/bomdb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecba11eea48a02dbd2088def40ef7b8aebf18142
|
4
|
+
data.tar.gz: f9a8272a8bbe4058f78ffe0dd1d11dc0f00f3928
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cfedb68510d5af0441f8c61ac792439a4ef2c8aa7f4db8354b73979b604216a2af88bc7fa452cacfbb5e9c4646954ae9502631662ef6286f9140374f387c793
|
7
|
+
data.tar.gz: 55b8d2ed0344d5a95aa70ccef94d07dfde84c659fd5599d70ac7dda01c91c448eafd398dadb6e0b2b7c99f12ac50b8c68e8e085b7b78e53f2ef62e6dac8e6301
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
BomDB is a command-line tool (packaged as a Ruby gem) that provides multiple editions of the Book of Mormon in machine-readable form. At its heart is a sqlite3 database--data can be imported or exported using various formats and options.
|
4
4
|
|
5
|
+
See the blog post [DIY Mosiah Priority with BomDB](http://blog.wordtree.org/2015/04/17/diy-mosiah-priority/) for further example usage.
|
6
|
+
|
5
7
|
## Usage
|
6
8
|
|
7
9
|
### SHOW a formatted edition of the Book of Mormon
|
@@ -58,6 +60,22 @@ Mosiah 5:2 And they all cried with one voice, saying: Yea, we believe...
|
|
58
60
|
Mosiah 5:6 And now these are the words which king Benjamin desired of them...
|
59
61
|
```
|
60
62
|
|
63
|
+
You can also search for specific terms in the Book of Mormon. Let's search for 'whoso' in 3rd Nephi:
|
64
|
+
|
65
|
+
```bash
|
66
|
+
$ bomdb show --search 'whoso' '3 Nephi 1-30'
|
67
|
+
```
|
68
|
+
|
69
|
+
This shows a color-highlighted result set (note: github markdown does not show color):
|
70
|
+
|
71
|
+
*3 Nephi 9:14* Yea, verily I say unto you: If ye will come unto me, ye shall have eternal life. Behold, mine arm of mercy is extended towards you. And **whoso**ever will come, him will I receive. And blessed are they which cometh unto me.
|
72
|
+
|
73
|
+
*3 Nephi 9:20* And ye shall offer for a sacrifice unto me a broken heart and a contrite spirit. And **whoso** cometh unto me with a broken heart and a contrite spirit, him will I baptize with fire and with the Holy Ghost, even as the Lamanites because of their faith in me at the time of their conversion were baptized with fire and with the Holy Ghost--and they knew it not.
|
74
|
+
|
75
|
+
|
76
|
+
[ ... 27 results skipped in this example ... ]
|
77
|
+
|
78
|
+
|
61
79
|
### IMPORT and EXPORT portions of the database
|
62
80
|
|
63
81
|
You can import and export any part of the database, such as the books, verses, editions, and contents (text) of the database.
|
data/data/book_of_mormon.db
CHANGED
Binary file
|
data/lib/bomdb/query.rb
CHANGED
@@ -35,8 +35,12 @@ module BomDB
|
|
35
35
|
q.where!(Sequel.like(Sequel.function(:LOWER, :content_body), "%#{@search.downcase}%"))
|
36
36
|
end
|
37
37
|
if @exclude
|
38
|
-
|
39
|
-
|
38
|
+
excluded_ref_names = @exclude.split(/\s*,\s*/).map do |name|
|
39
|
+
Sequel.like(:ref_name, "#{name}%")
|
40
|
+
end
|
41
|
+
excluded_verse_ids = db[:refs].
|
42
|
+
select(:verse_id).
|
43
|
+
where(excluded_ref_names)
|
40
44
|
if @exclude_only_quotations
|
41
45
|
excluded_verse_ids.where!(ref_is_quotation: true)
|
42
46
|
end
|
data/lib/bomdb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bomdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Duane Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|