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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6045b00d06ff5e4d4ae162ef54fe995df71ab90b
4
- data.tar.gz: f252a2454c9a02f8db6e45ebcded298c1a52ef57
3
+ metadata.gz: ecba11eea48a02dbd2088def40ef7b8aebf18142
4
+ data.tar.gz: f9a8272a8bbe4058f78ffe0dd1d11dc0f00f3928
5
5
  SHA512:
6
- metadata.gz: 40de7880d7173f51e6505b5ca829ffdd056a81122b30561cd931f49f70c970800cbcbdf88fbd7835adc4ff90eabd50d43fb51020dc9a997ca2babf630b3cfa83
7
- data.tar.gz: c9f8a9bcae9d097675516cea81320f18c22b3f605ab3401b1222675d15a600301ebeffc5eb5b41b28ed44621fbb23887d3654e6733550a630f990d40f8600eb6
6
+ metadata.gz: 8cfedb68510d5af0441f8c61ac792439a4ef2c8aa7f4db8354b73979b604216a2af88bc7fa452cacfbb5e9c4646954ae9502631662ef6286f9140374f387c793
7
+ data.tar.gz: 55b8d2ed0344d5a95aa70ccef94d07dfde84c659fd5599d70ac7dda01c91c448eafd398dadb6e0b2b7c99f12ac50b8c68e8e085b7b78e53f2ef62e6dac8e6301
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bomdb (0.6.0)
4
+ bomdb (0.6.1)
5
5
  colorize (~> 0.7)
6
6
  constellation (~> 0.1)
7
7
  levenshtein-ffi (~> 1.1)
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.
Binary file
@@ -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
- excluded_verse_ids = db[:refs].select(:verse_id).
39
- where(:ref_name => @exclude.split(/\s*,\s*/))
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
@@ -1,3 +1,3 @@
1
1
  module BomDB
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
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.1
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-18 00:00:00.000000000 Z
11
+ date: 2015-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel