cutword 2.0.0.pre.alpha2 → 2.0.0
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 +7 -13
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d40a4b29d85fd119f33316672a7a6b6f20645b24ee6f4c9366d4c343bad54e4
|
4
|
+
data.tar.gz: 1899724a1e1e5c2dde1fe6317e758eba0a476000dd56bc771eb5d8f1c83534e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b05ed9f572cb54923cd0c3aa3c964bf46f3857e1fb90d4e8e73b4f2b909f9be05009f097b3202ee3c8ec76777f5cf60c79a1d6e74adb727ca3a6533555a9c19
|
7
|
+
data.tar.gz: '0459bcdc940f1fa2363e7739d18c395b6c1682b4a09b5a6781cee0e023094d372b5cebb5822468c62ceec2c1753b73a049bdad613781f7c39847580530d2b3b0'
|
data/lib/cutword/version.rb
CHANGED
data/lib/cutword.rb
CHANGED
@@ -1,16 +1,10 @@
|
|
1
1
|
# lib/cutword.rb
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
truncated_text = text[0...max_length].strip
|
10
|
-
truncated_text + (truncated_text.length < text.length ? '...' : '')
|
11
|
-
else
|
12
|
-
text
|
13
|
-
end
|
14
|
-
end
|
3
|
+
def Cutword(max_length, text)
|
4
|
+
if text.length > max_length
|
5
|
+
truncated_text = text[0...max_length].strip
|
6
|
+
truncated_text + (truncated_text.length < text.length ? '...' : '')
|
7
|
+
else
|
8
|
+
text
|
15
9
|
end
|
16
|
-
end
|
10
|
+
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
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Demjhon Silver
|
@@ -11,7 +11,7 @@ cert_chain: []
|
|
11
11
|
date: 2024-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This gem provides string truncation and word cutting functionality for
|
14
|
-
both Rails and Hanami.
|
14
|
+
both Rails and Hanami Framework.
|
15
15
|
email: none
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
@@ -34,13 +34,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
34
34
|
version: 3.0.0
|
35
35
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "
|
37
|
+
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: '0'
|
40
40
|
requirements: []
|
41
41
|
rubygems_version: 3.4.10
|
42
42
|
signing_key:
|
43
43
|
specification_version: 4
|
44
44
|
summary: A simple gem for truncating words/strings or shortening words and names,
|
45
|
-
compatible with Rails and Hanami.
|
45
|
+
compatible with Rails and Hanami Framework.
|
46
46
|
test_files: []
|