summarise 0.0.1 → 1.0.0

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
  SHA1:
3
- metadata.gz: 3bde7a0827acbb3d218796147a2ea72b2b90db7e
4
- data.tar.gz: 8ae66dc7df7b0d452fbb769a2737ebdb5e424e70
3
+ metadata.gz: 1cd42215f8bf26f1a2a6ddf1b5e122519a61b1bd
4
+ data.tar.gz: f7c3c7ca67e2557eb86098999e4cf63a52539e71
5
5
  SHA512:
6
- metadata.gz: 3e2460b8876c230d66668ca166b4958b832873b80a4790eaf54185e041f1bbdce4a501b78ac83a82efebfdf516ed10d7e4651f3cba48eb570f0da24277ea134b
7
- data.tar.gz: 4f9a16d6e84dbad7f3b087bc46d89097220417294541dce998b9b2c6e7df184a4a59a051ac08a67c65b577cd873ee716f73fbcc8965c52d6e392e410d73a3910
6
+ metadata.gz: e6d598573b183a85a331e90a323956ba3abe3e2bf390f3a163c536cdea41350c8e7656f33f5ef1a61ee90e33698f238e44305f97d8f20456383535ae297909e5
7
+ data.tar.gz: 9115804488f9eb3d628c93801ef3d16f05700ce0b4ba8f058df04e89b108ff09184f23d66def7303878c05e44d951af6c2c686b58ded5691164befed9dc7a2b6
@@ -1,10 +1,14 @@
1
1
 
2
2
  module Summarise
3
3
  module StringExtensions
4
- def summarise(l=200)
5
- i = 0
6
- self.split.map{ |word| word if (i += word.length) < l}.compact.join(' ')
4
+ def summarize(l=200, args={})
5
+ i = 0
6
+ summary = self.split.map{ |word| word if (i += word.length) < l}.compact.join(' ')
7
+ if args[:suffix] && self != summary
8
+ summary << args[:suffix]
7
9
  end
10
+ summary
11
+ end
8
12
 
9
13
  def summarisable?(length=200)
10
14
  return self.summarise(length) != self
@@ -1,3 +1,3 @@
1
1
  module Summarise
2
- VERSION = "0.0.1"
2
+ VERSION = "1.0.0"
3
3
  end
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: 0.0.1
4
+ version: 1.0.0
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-08-21 00:00:00.000000000 Z
11
+ date: 2013-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler