lifer 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae7d44054aac227a4d75940cf8c6d30b46ba403780f5d8583d0db22dfd8cf36e
4
- data.tar.gz: 7c8ac4e684afa95e23f22dc1b6ad0472391c3fc946a6b7bbbdf9acfbf46ac31d
3
+ metadata.gz: '0628d28de38f509eb51cc2d2dd65cb794fe3e4e46239bbf11c82decfd28f1d5d'
4
+ data.tar.gz: dcb12aba6fa318f57c3224fed97a6a28233b847ca7399f321c855a739a44543b
5
5
  SHA512:
6
- metadata.gz: 464566f240f05e2c5e199582555ccecd9bc6449ad477d53adb24905d76e07b9f93c13d050f69cd6c5923f9f9434edca1d14b4d01d674c5b4148bb5d9c85723df
7
- data.tar.gz: 270f4d8c20bc24b180ae474a6d62037b2f2347a4d9e25f7a4af207d0e85d6df66fec0f92a82f57248e05ac34966ba69ff542a30c9e36d4f90e99fe41a46eeba6
6
+ metadata.gz: 0d74bf3c194492fec78a17ca70045dd107a40ddf33cf154243b33bb0a9d13876b1b0bdc4ea6bbf40c15984bf6a2a86dc898ed55939c9e222cf86d4cadd73b8d3
7
+ data.tar.gz: af6d75bd7b875807c8fc74c69b04c5849d0d5e787a4ae6516f8af5189eb22e668d249660f741802b90209d9c2697909ae69400f364fc80a7dfe703a69490bb78
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Next
2
2
 
3
+ ## v0.10.2
4
+
5
+ This release resolves another bug in `Entry#summary` causing entries without
6
+ full-stops within the truncation threshold to not be truncated with a "..."
7
+ properly.
8
+
3
9
  ## v0.10.1
4
10
 
5
11
  This release resolves a bug with `Entry#summary`. When I originally implemented
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lifer (0.10.1)
4
+ lifer (0.10.2)
5
5
  i18n (< 2)
6
6
  kramdown (~> 2.4)
7
7
  liquid (~> 5.6, < 6)
@@ -35,12 +35,12 @@ class Lifer::Entry::Markdown < Lifer::Entry
35
35
  text = raw_first_paragraph_text
36
36
  return text if text.length <= TRUNCATION_THRESHOLD
37
37
 
38
- truncated_text = text[0..TRUNCATION_THRESHOLD]
39
- if (index_of_final_fullstop = text.rindex ". ")
40
- truncated_text[0..index_of_final_fullstop]
41
- else
42
- "%s..." % truncated_text
43
- end
38
+ text = text[0..TRUNCATION_THRESHOLD]
39
+
40
+ # Index of the fullstop from the last complete sentence in the truncated
41
+ # text.
42
+ last_fullstop_index = text.rindex /(\.) /
43
+ last_fullstop_index ? text[0..last_fullstop_index] : "%s..." % text
44
44
  end
45
45
 
46
46
  # The title or a default title.
data/lib/lifer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lifer
2
- VERSION = "0.10.1"
2
+ VERSION = "0.10.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lifer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - benjamin wil
@@ -210,8 +210,8 @@ licenses:
210
210
  - MIT
211
211
  metadata:
212
212
  allowed_push_host: https://rubygems.org
213
- homepage_uri: https://github.com/benjaminwil/lifer/blob/v0.10.1/README.md
214
- source_code_uri: https://github.com/benjaminwil/lifer/tree/v0.10.1
213
+ homepage_uri: https://github.com/benjaminwil/lifer/blob/v0.10.2/README.md
214
+ source_code_uri: https://github.com/benjaminwil/lifer/tree/v0.10.2
215
215
  changelog_uri: https://github.com/benjaminwil/lifer/blob/main/CHANGELOG.md
216
216
  post_install_message:
217
217
  rdoc_options: []