kj_reading 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/kj_reading.rb +25 -5
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dddaf6ccb1e9be9127fbaabdb4258062a0d8fde
|
4
|
+
data.tar.gz: f55214a5e36069ca3e8583c87a3b8c640a98cb3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 620dfa5f1e2cf91f71cf0c957700ba0f7f3eabd5e8d6fff35cc0761e97f88d972ca5123d6cbf026543aaa4678a42e81a494af77e34da1a5bf775a8ca53a48ba9
|
7
|
+
data.tar.gz: 6eea3f9256a07c74ae39b23f921e439f9e6b22fe72d054e139e64645b78217d93369645547b131eb8424a7c6404ad04e81b951282fc2efa838c5257df66f58c8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/kj_reading.rb
CHANGED
@@ -11,13 +11,33 @@ class KjReading
|
|
11
11
|
|
12
12
|
bible = Kj::Bible.new
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
s.strip.lines.map do |line|
|
15
|
+
|
16
|
+
r = line.match(/(?<book>\w+)\s+(?<chapter>\d+)[,\:]?\s*(?<verses>.*)/)
|
17
|
+
verses = r[:verses] =~ /(?:\.\.|,|-)/ ? Range.new(*r[:verses]\
|
18
|
+
.split(/(?:\.\.|,|-)/).map(&:to_i)).to_a : r[:verses]
|
19
|
+
|
20
|
+
"\n" + bible.books(r[:book])[0].chapter(r[:chapter])\
|
21
|
+
.verses(verses).join(' ') + "\n" + line + "\n"
|
18
22
|
|
19
|
-
|
23
|
+
end.join
|
20
24
|
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.abbrev(s)
|
28
|
+
|
29
|
+
Kj::Bible.new.books(s)[0].abbreviations
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.books()
|
34
|
+
|
35
|
+
h = Kj::Bible.new.books.inject({}) do |r,x|
|
36
|
+
r.merge(x.name.downcase => x.abbreviations.split(','))
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
21
41
|
def self.check(s)
|
22
42
|
Kj::Bible.new.books(s)[0].name
|
23
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kj_reading
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
sB6wQxY9xLzIB9fpQFU2y+zLTh80VMYQNuE8eXjXMmSEK9wob9e0IUVSJ0ClxuFh
|
31
31
|
xqg=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2018-
|
33
|
+
date: 2018-07-22 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: kj
|
metadata.gz.sig
CHANGED
Binary file
|