cliutils 2.2.4 → 2.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/HISTORY.md +4 -0
- data/README.md +0 -1
- data/lib/cliutils/constants.rb +1 -1
- data/lib/cliutils/ext/string_extensions.rb +8 -0
- 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: 381dc60476fc447deccdb6d6ad014317ae2784ec
|
4
|
+
data.tar.gz: 24fc1307bbb0bf38aa08a4c5b5fe15c278108a3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffd39e65b7fa7b305a0251c91a118948f4078b89c4063c5469da316667d6c674e1666797ca570ffcae5f0172f5b508c46366909ad6b8d233ae5ad112eea40cf5
|
7
|
+
data.tar.gz: 97a14e4864053fc4a61a4595a90b16283ea864e52846a9626f06dccdee6c2a6ab36949a65e966289e026d2516e91179ad133a1af01903830d6f3267ece189c45
|
data/.travis.yml
CHANGED
data/HISTORY.md
CHANGED
data/README.md
CHANGED
data/lib/cliutils/constants.rb
CHANGED
@@ -55,6 +55,14 @@ class String
|
|
55
55
|
downcase
|
56
56
|
end
|
57
57
|
|
58
|
+
# Truncates a string to a certain length
|
59
|
+
# and adds an ellipsis after.
|
60
|
+
# @param [Fixnum] length The length to truncate at
|
61
|
+
# @return [String]
|
62
|
+
def truncate(length = 30)
|
63
|
+
self[0..length].gsub(/\s\w+\s*$/, '...')
|
64
|
+
end
|
65
|
+
|
58
66
|
# Makes the associated string white.
|
59
67
|
# @return [void]
|
60
68
|
def white
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cliutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Bach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|