cutword 2.0.0.pre.alpha1 → 2.0.0.pre.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cutword/version.rb +1 -1
- data/lib/cutword.rb +13 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f7e9a8fcd185e1ec47ec3a222413f9b828537791e1f026ef5f7442d236909c8
|
4
|
+
data.tar.gz: 59482810eeb3180668222ae9b51f1a74ed12982ef3c9cad8c2ffcc261629852d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a98830366a52b60c84a4bd1726934c86c14a05411b0a5279a88fca62f0996d0e0dac8db50e8ba4c84d521eb6eb20516d0f43966e580ed4bfb9756db38d56b19
|
7
|
+
data.tar.gz: a3351559f6c7d253ed6a13d4689edab9809f9e2049dd850e0e3812dbe157e7a5075f3ee73f6f0adfb5628f330987ce6425621e80b3edc8b88561056383be307c
|
data/lib/cutword/version.rb
CHANGED
data/lib/cutword.rb
CHANGED
@@ -1,10 +1,16 @@
|
|
1
1
|
# lib/cutword.rb
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
|
4
|
+
|
5
|
+
module Cutword
|
6
|
+
class << self
|
7
|
+
def get(max_length, text)
|
8
|
+
if text.length > max_length
|
9
|
+
truncated_text = text[0...max_length].strip
|
10
|
+
truncated_text + (truncated_text.length < text.length ? '...' : '')
|
11
|
+
else
|
12
|
+
text
|
13
|
+
end
|
14
|
+
end
|
9
15
|
end
|
10
|
-
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cutword
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.pre.
|
4
|
+
version: 2.0.0.pre.alpha2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Demjhon Silver
|
@@ -31,7 +31,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 3.0.0
|
35
35
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - ">"
|