caboose-cms 0.4.108 → 0.4.109
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/caboose/engine.rb +8 -3
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGJlYTVjNGY4Y2I2NjgwMDA0MDAwOTZhMTJlM2RlNGJlYzEyZjJiNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTgwYmYzMGYwY2MyMDJmNWFkNzI0MTgzNjNlZTA5MjFlYjM4MGJjYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzUyMGIyNmU0M2U0MjkxMTY4MTU5ZDRiYzk1ZmM1N2YzZGMyZDUxYjE3ZWYy
|
10
|
+
ZGU4NmU2OTAxZmFlMWQxNjVlZmViODgwMmI0MThiOWY1MGRkYTU3ZjUwNWRi
|
11
|
+
YjFhZGU2ZDUwZTcwMzVlZGNkZTU4YTliNGMzNDljOTgyMDBlOTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Yzg2Nzk0NTUyNDU1NzY1MjUzNmM2MzE4MDMzZjBkNmQwMjI1NGU3NmRjNTM5
|
14
|
+
MjJkZDMwOGRjYTc2YWZhM2ViZGRmY2Y5NjdkYmQwNzMzZjljMmMwMTMxYzY3
|
15
|
+
Y2U2YjQzOTZjYzY2MjEzNzFhYjM4YTUwYjZhOTM0Y2M1YjEzZGM=
|
data/lib/caboose/engine.rb
CHANGED
@@ -55,11 +55,16 @@ module Caboose
|
|
55
55
|
|
56
56
|
# Strips html and returns the text that breaks closest to the given length
|
57
57
|
def Caboose.teaser_text(str, length = 100)
|
58
|
-
return
|
58
|
+
return '' if str.nil?
|
59
59
|
str2 = ActionController::Base.helpers.strip_tags(str).gsub("\n", ' ')
|
60
|
+
return '' if str2.nil? || str2.length == 0
|
60
61
|
if str2.length > length
|
61
|
-
i = str2.index(' ', length)
|
62
|
-
|
62
|
+
i = str2.index(' ', length)
|
63
|
+
if i.nil?
|
64
|
+
i = length
|
65
|
+
else
|
66
|
+
i = i - 1
|
67
|
+
end
|
63
68
|
str2 = str2[0..i]
|
64
69
|
str2[str2.length-1] = "" if str2.ends_with?(",")
|
65
70
|
str2 = "#{str2}..."
|
data/lib/caboose/version.rb
CHANGED