kj_reading 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data/lib/kj_reading.rb +28 -17
- data.tar.gz.sig +0 -0
- metadata +29 -24
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8199ce39641557435790b0c361b93178c68d86145b170e0cc07b5b477f7a03ab
|
4
|
+
data.tar.gz: 3510893d69e2e61ff44f31ced6908b922ca3b6432a1c6472372df4a0f0b8cba4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a90543c78ee3847e0387fc2fe46ae26b518c33ef782c2e09579ca081ef3c34d63cd73c115e6b81ab2be9b9186b24ff906389d9a0b9af21c62f86d4a5c5ec892
|
7
|
+
data.tar.gz: 8f31a0aab166c620b28b4799549a67f4aa857e1755ae1b1ebc5066d680f4b24880f2e27987c286b6a14b26af4020e9f723509f8a38fc7094c8c8df35b58bfaa7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/kj_reading.rb
CHANGED
@@ -5,39 +5,50 @@
|
|
5
5
|
require 'kj'
|
6
6
|
|
7
7
|
|
8
|
+
class KjReadingErr < Exception
|
9
|
+
end
|
10
|
+
|
8
11
|
class KjReading
|
9
12
|
|
10
13
|
def self.text(s)
|
11
14
|
|
12
|
-
bible = Kj::Bible.new
|
13
|
-
|
14
15
|
s.strip.lines.map do |line|
|
15
|
-
|
16
|
-
|
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"
|
16
|
+
|
17
|
+
"\n" + self.verses(s).join(' ') + "\n" + line + "\n"
|
22
18
|
|
23
19
|
end.join
|
24
20
|
|
25
21
|
end
|
26
|
-
|
22
|
+
|
23
|
+
def self.verses(s)
|
24
|
+
|
25
|
+
bible = Kj::Bible.new
|
26
|
+
|
27
|
+
r = s.match(/(?<book>\w+)\s+(?<chapter>\d+)[,\:]?\s*(?<verses>.*)/)
|
28
|
+
verses2 = r[:verses] =~ /(?:\.\.|,|-)/ ? Range.new(*r[:verses]\
|
29
|
+
.split(/(?:\.\.|,|-)/).map(&:to_i)).to_a : r[:verses]
|
30
|
+
|
31
|
+
books = bible.books(r[:book])
|
32
|
+
raise KjReadingErr, 'More than 1 book found' if books.length > 1
|
33
|
+
books[0].chapter(r[:chapter])\
|
34
|
+
.verses(verses2)
|
35
|
+
|
36
|
+
end
|
37
|
+
|
27
38
|
def self.abbrev(s)
|
28
|
-
|
39
|
+
|
29
40
|
Kj::Bible.new.books(s)[0].abbreviations
|
30
|
-
|
41
|
+
|
31
42
|
end
|
32
|
-
|
43
|
+
|
33
44
|
def self.books()
|
34
|
-
|
45
|
+
|
35
46
|
h = Kj::Bible.new.books.inject({}) do |r,x|
|
36
47
|
r.merge(x.name.downcase => x.abbreviations.split(','))
|
37
48
|
end
|
38
|
-
|
49
|
+
|
39
50
|
end
|
40
|
-
|
51
|
+
|
41
52
|
def self.check(s)
|
42
53
|
Kj::Bible.new.books(s)[0].name
|
43
54
|
end
|
@@ -48,7 +59,7 @@ end
|
|
48
59
|
if __FILE__ == $0 then
|
49
60
|
|
50
61
|
# e.g. KjReading.text 'mt 16, 18'
|
51
|
-
# e.g. KjReading.text '1co 1, 22..29'
|
62
|
+
# e.g. KjReading.text '1co 1, 22..29'
|
52
63
|
|
53
64
|
KjReading.text ARGV.first
|
54
65
|
|
data.tar.gz.sig
CHANGED
Binary file
|
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.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,27 +10,33 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
+
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
13
|
+
MIIEljCCAv6gAwIBAgIBATANBgkqhkiG9w0BAQsFADBIMRIwEAYDVQQDDAlnZW1t
|
14
|
+
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
+
8ixkARkWAmV1MB4XDTIyMDcxNDE2MzE0N1oXDTIzMDcxNDE2MzE0N1owSDESMBAG
|
16
|
+
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
|
+
EjAQBgoJkiaJk/IsZAEZFgJldTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoC
|
18
|
+
ggGBAN4+s37ay9Aa66ANRbgzQGjWIAhGW+nath4PkmsDUWFmyq/lpUpJ9wAojlcH
|
19
|
+
5bkK1h+yiK9Oi15UyIAxwtK1jZuKs+VWT7+7JDIYFEq8b3pmKfUHmTWU9u2GCptq
|
20
|
+
incE0SqjmhZrrCoRH+vghcpv29iunSLEx7cngJW7g9W4755C/fUFxsBRPZsatQ0L
|
21
|
+
WEfgp2RQwtd9BZLEY5eQCw5fcJPQhhvCwioVoKUjpHiaq/AcE1DcZQdwdO4HdpkD
|
22
|
+
0u+6Op5QaIgRpHxyadfipa49Hxnac3rAn2g9HYbVDD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op/tBEdNK6U+BG6Ehw1SQU=
|
32
38
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
39
|
+
date: 2022-07-14 00:00:00.000000000 Z
|
34
40
|
dependencies:
|
35
41
|
- !ruby/object:Gem::Dependency
|
36
42
|
name: kj
|
@@ -53,7 +59,7 @@ dependencies:
|
|
53
59
|
- !ruby/object:Gem::Version
|
54
60
|
version: 0.0.16
|
55
61
|
description:
|
56
|
-
email:
|
62
|
+
email: digital.robertson@gmail.com
|
57
63
|
executables: []
|
58
64
|
extensions: []
|
59
65
|
extra_rdoc_files: []
|
@@ -78,8 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
84
|
- !ruby/object:Gem::Version
|
79
85
|
version: '0'
|
80
86
|
requirements: []
|
81
|
-
|
82
|
-
rubygems_version: 2.6.13
|
87
|
+
rubygems_version: 3.3.7
|
83
88
|
signing_key:
|
84
89
|
specification_version: 4
|
85
90
|
summary: 'A wrapper of the Kj gem. Usage: KjReading.text "mt 16, 18"'
|
metadata.gz.sig
CHANGED
Binary file
|