bible_bot 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bible_bot/reference.rb +3 -2
- data/lib/bible_bot/verse.rb +3 -2
- data/lib/bible_bot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9916c2ab85ce75d756b6afb51d332cda0a13b8b5d4c578e377777ed99d3689e8
|
4
|
+
data.tar.gz: 69b16b95ac47ee4184ddc010360ca0432b8b36b46b6a727ce29440286f4f1892
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4962346de98f90e84907ef1beedb903cd192e4e27534ebfb6223056651c3cc3712a1b7d3302eb4f812ae7484cbe9829cdec64ccaaf862a2db3d2f537e3daa01f
|
7
|
+
data.tar.gz: a6394ed4251f8730a031a8a53b8387b9e36319259bc3070a4204d9ed0d3aed3b2c6284c2605d15ccc451b6604af896fef39c5010e52ec23adae907c9326af118
|
data/lib/bible_bot/reference.rb
CHANGED
@@ -46,11 +46,12 @@ module BibleBot
|
|
46
46
|
|
47
47
|
# Returns a formatted string of the {Reference}.
|
48
48
|
#
|
49
|
+
# @param include_chapter_on_single_chapter_books [Boolean]
|
49
50
|
# @return [String]
|
50
51
|
# @example
|
51
52
|
# reference.formatted #=> "Genesis 2:4-5:9"
|
52
|
-
def formatted
|
53
|
-
formatted_verses = [start_verse.formatted(include_verse: !full_chapters
|
53
|
+
def formatted(include_chapter_on_single_chapter_books: false)
|
54
|
+
formatted_verses = [start_verse.formatted(include_verse: !full_chapters?, include_chapter_on_single_chapter_books: include_chapter_on_single_chapter_books)]
|
54
55
|
|
55
56
|
if end_verse && end_verse > start_verse && !(same_start_and_end_chapter? && full_chapters?)
|
56
57
|
formatted_verses << end_verse.formatted(
|
data/lib/bible_bot/verse.rb
CHANGED
@@ -73,15 +73,16 @@ module BibleBot
|
|
73
73
|
|
74
74
|
# @param include_book [Boolean]
|
75
75
|
# @param include_chapter [Boolean]
|
76
|
+
# @param include_chapter_on_single_chapter_books [Boolean]
|
76
77
|
# @param include_verse [Boolean]
|
77
78
|
# @return [String]
|
78
79
|
# @example
|
79
80
|
# verse.formatted #=> "Genesis 5:23"
|
80
|
-
def formatted(include_book: true, include_chapter: true, include_verse: true)
|
81
|
+
def formatted(include_book: true, include_chapter: true, include_chapter_on_single_chapter_books: false, include_verse: true)
|
81
82
|
str = String.new # Using String.new because string literals will be frozen in Ruby 3.0
|
82
83
|
str << "#{book.formatted_name} " if include_book
|
83
84
|
|
84
|
-
if book.single_chapter?
|
85
|
+
if book.single_chapter? && include_chapter_on_single_chapter_books == false
|
85
86
|
str << "#{verse_number}" if include_verse
|
86
87
|
else
|
87
88
|
str << "#{chapter_number}" if include_chapter
|
data/lib/bible_bot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bible_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff McFadden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|