caboose-cms 0.2.92 → 0.2.93
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 +8 -8
- data/lib/caboose/engine.rb +14 -0
- 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
|
+
NDdhODU5NjFkMDk3NmMxYWY1ZWFmMWY5MDc3ZmFjMDZhNTA2ZWRhOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWI2ODBjNjgwNWI4OGMzNWE1MWIyM2EwODlmZjI2MzJhMzUxM2FmOQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGMwZTIwNDU5NTRjOGNkODBjNDQ0NWNjYmE4ZWY5NDQxZmEwMTc5OTgwN2Zj
|
10
|
+
YmVkMzk4ZTMwZWM1ZjExZjU2YTJmMDZiNzkzMmU0Zjk5Yzc0NDE3M2U4ZTY3
|
11
|
+
MWFhOTFhNWUwNWViMTE2MjIxZGY0MzQ5NGIzZGNmOGFlMzMzMWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjlmYjVlNzZiMWI5NTZmN2QwZjhlNGU0MDM1MmQ0ODUwMzZlZmViMzA5NTgw
|
14
|
+
YWQxMDJlMTIxZThmNzQyNWVlYzE0NWUzMTgwZDI0MjgyNjUzYTdkYThjMDZm
|
15
|
+
ZWQ3NjQzYzNhNDhlMTQxOGEwMTFkOTQ0NjcwN2M5NjA5YmE5Mzg=
|
data/lib/caboose/engine.rb
CHANGED
@@ -77,6 +77,20 @@ module Caboose
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
+
# Strips html and returns the text that breaks closest to the given length
|
81
|
+
def Caboose.teaser_text(str, length = 100)
|
82
|
+
return "" if str.nil?
|
83
|
+
str2 = ActionController::Base.helpers.strip_tags(str)
|
84
|
+
if str2.length > 200
|
85
|
+
i = str2.index(' ', 200) - 1
|
86
|
+
i = 200 if i.nil?
|
87
|
+
str2 = str2[0..i]
|
88
|
+
str2[str2.length-1] = "" if str2.ends_with?(",")
|
89
|
+
str2 = "#{str2}..."
|
90
|
+
end
|
91
|
+
return str2
|
92
|
+
end
|
93
|
+
|
80
94
|
class Engine < ::Rails::Engine
|
81
95
|
isolate_namespace Caboose
|
82
96
|
end
|
data/lib/caboose/version.rb
CHANGED