buzzcore 0.4.1 → 0.4.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.
- data/VERSION +2 -1
- data/buzzcore.gemspec +2 -2
- data/lib/buzzcore/extra/html_truncate.rb +4 -2
- metadata +2 -2
data/VERSION
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
0.4.
|
|
1
|
+
0.4.2
|
|
2
|
+
|
data/buzzcore.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{buzzcore}
|
|
8
|
-
s.version = "0.4.
|
|
8
|
+
s.version = "0.4.2"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["buzzware"]
|
|
12
|
-
s.date = %q{2010-
|
|
12
|
+
s.date = %q{2010-06-05}
|
|
13
13
|
s.description = %q{buzzcore is the ruby core library developed and used by Buzzware Solutions.}
|
|
14
14
|
s.email = %q{contact@buzzware.com.au}
|
|
15
15
|
s.extra_rdoc_files = [
|
|
@@ -6,7 +6,7 @@ module HtmlUtils
|
|
|
6
6
|
# Truncates HTML text. Breaks on word boundaries and closes tags.
|
|
7
7
|
# valid values for aLevel are :NO_TAGS, :RESTRICTED, :BASIC and :RELAXED
|
|
8
8
|
def self.word_safe_truncate(aHtmlText,aMaxLength,aSuffix='...',aLevel=:BASIC)
|
|
9
|
-
result = StringUtils.word_safe_truncate(aHtmlText,aMaxLength)
|
|
9
|
+
result = StringUtils.word_safe_truncate(aHtmlText,aMaxLength)
|
|
10
10
|
level = case aLevel
|
|
11
11
|
when :NO_TAGS
|
|
12
12
|
nil
|
|
@@ -19,7 +19,9 @@ module HtmlUtils
|
|
|
19
19
|
else
|
|
20
20
|
Sanitize::Config::BASIC
|
|
21
21
|
end
|
|
22
|
-
|
|
22
|
+
result = level ? Sanitize.clean(result,level) : Sanitize.clean(result)
|
|
23
|
+
result += ' '+aSuffix
|
|
24
|
+
result
|
|
23
25
|
end
|
|
24
26
|
|
|
25
27
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: buzzcore
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- buzzware
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2010-
|
|
12
|
+
date: 2010-06-05 00:00:00 +08:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|