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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 104716fdd025941b40d6626690048a72109da1b23fd6e68a5918d193e3d46839
4
- data.tar.gz: 8ba2af722b2c14327f9d2e708f5b103727b44e50a891c6117fb66f393f3e757d
3
+ metadata.gz: 9916c2ab85ce75d756b6afb51d332cda0a13b8b5d4c578e377777ed99d3689e8
4
+ data.tar.gz: 69b16b95ac47ee4184ddc010360ca0432b8b36b46b6a727ce29440286f4f1892
5
5
  SHA512:
6
- metadata.gz: d32d3e5e490afc029508a8514485cbef3db87ff783f8eeb8384fbd531385cd97f61e1b165e454bc6b02db2497a6a89d566b63f55b79b7e1c53d8f9bbe04933f1
7
- data.tar.gz: faa5c83aff4c9ec81f197147cf30d5c86d2e3b81c0c772fba6ffdcb299ce21f70275dcba01410c7dbde665057afcb67db1b6561b28912003485bf7b0c398a095
6
+ metadata.gz: 4962346de98f90e84907ef1beedb903cd192e4e27534ebfb6223056651c3cc3712a1b7d3302eb4f812ae7484cbe9829cdec64ccaaf862a2db3d2f537e3daa01f
7
+ data.tar.gz: a6394ed4251f8730a031a8a53b8387b9e36319259bc3070a4204d9ed0d3aed3b2c6284c2605d15ccc451b6604af896fef39c5010e52ec23adae907c9326af118
@@ -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(
@@ -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
@@ -1,3 +1,3 @@
1
1
  module BibleBot
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
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.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-07-16 00:00:00.000000000 Z
11
+ date: 2020-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec