summarise 1.0.2 → 1.0.3
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 +4 -4
- data/lib/summarise/string_extensions.rb +6 -2
- data/lib/summarise/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ece8bc3795402c67d91eac7c561bf96d065d944f
|
4
|
+
data.tar.gz: 8a317443626495aa93288d9ca1ddbdf4b9cff185
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fccaab3337862dc02124da89b8c9009942ff7a6b1543f97b6a30ae4d996d8d3eb4e80996bf19112381f3c9306b95d81631a26ec21145e9fac61ff537b0209b36
|
7
|
+
data.tar.gz: e3db78cfe0e143fabdf9e1996248c1a73a98ef9ae599baede7a5242f60bc9048c0788136890f87eaf8dc644e5d8e90e1d7e54e7f30e9b7654cb639236ddc1671
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
module Summarise
|
3
3
|
module StringExtensions
|
4
|
-
def
|
4
|
+
def summarise(l=200, args={})
|
5
5
|
i = 0
|
6
6
|
summary = self.split.map{ |word| word if (i += word.length) < l}.compact.join(' ')
|
7
7
|
if args[:suffix] && self != summary
|
@@ -10,8 +10,12 @@ module Summarise
|
|
10
10
|
summary
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def summarizable?(length=200)
|
14
14
|
return self.summarise(length) != self
|
15
15
|
end
|
16
|
+
|
17
|
+
alias_method :summarize, :summarise
|
18
|
+
alias_method :summarizable?, :summarisable?
|
19
|
+
|
16
20
|
end
|
17
21
|
end
|
data/lib/summarise/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: summarise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|