pcurtail 0.0.1

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.
Files changed (3) hide show
  1. checksums.yaml +15 -0
  2. data/lib/pcurtail.rb +14 -0
  3. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NjI1MzJjOTgxYWFlYjllYTEyOWMzODdmODM0MmJiOGZiZGIyOTQ2ZA==
5
+ data.tar.gz: !binary |-
6
+ ZmM1NmNiZjExODgxN2UzMmY3MzU4ZGUyMDk4YTJlOGRkYmY0NWUzZA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZTU3ODM0OTQ3ZWY4ZGZiNjEyODRlMWY2YjhmYTgzZTMyNWM1ZGIxNGQyYmY1
10
+ ZjA5M2M4ZDMyMTA5NDdlYzY2ZGI5MzcwN2JhNmNlYTFkYzY3ZTU5NmQyNmFh
11
+ ODZkNWFkNTRkNjQ5ZjQzYzYwYmViZThhMmU2Y2M1ODlkNWM2MmE=
12
+ data.tar.gz: !binary |-
13
+ ZGY0MDk4YTI3Mzk4ZDMzOTIyNzNiNzQ5YjQzN2RiNDY2MzExNTM5ZGE0YTBj
14
+ NDM5ZTIzMzEwODA1ZjE5YjIyNDc5ZTY0NDE4ODkzMTMyNDExN2QwMDE5Y2Vi
15
+ ZTY5YzNhNGIwN2ZmZjc4OTBkMzY2OWYwMDNmZTYzOGM3YmFkYjA=
data/lib/pcurtail.rb ADDED
@@ -0,0 +1,14 @@
1
+ module PCurtail
2
+ def self.do(p, len)
3
+ $r = ""
4
+ for w in p.split
5
+ if $r.length + w.length > len-3
6
+ $r += '...'
7
+ break
8
+ else
9
+ $r += "#{w} "
10
+ end
11
+ end
12
+ return $r
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pcurtail
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - ceire
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-12 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Curtails a string that is supposed to have many words to max size specified
14
+ while does not cut words
15
+ email: ccz@gmx.us
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/pcurtail.rb
21
+ homepage: http://rubygems.org/gems/pcurtail
22
+ licenses:
23
+ - SimPL-2.0
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.2.1
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Curtails a phrase/paragraph
45
+ test_files: []