cutword 1.0.0 → 2.0.0.pre.alpha1
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 +9 -9
- data/lib/cutword/get_string.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 199a540076326f10851cfc795361210cecfdfdad48a76f1e9f0e6e0452157d76
|
4
|
+
data.tar.gz: e63632a8ba506b8de4eef22e7394c9dfe103d7c7e419d9fb55f1ab7522dd5251
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3f4880c7319f1bd6b2cb60b6e0073b4ba280c8ea02da3ec5df4dbc620d068c96cfecbefa5ba83d405de6613c7275542cc6325b098145cbe740988321735111b
|
7
|
+
data.tar.gz: 1b53266d6711324dde744d3ff18d13b28172d1e150895b7fc0bf34c633080afd98f2318a11f18ac7496945d5ca421230ea309d98580fda215573e7c771974daf
|
data/lib/cutword/version.rb
CHANGED
data/lib/cutword.rb
CHANGED
@@ -1,16 +1,10 @@
|
|
1
|
-
|
2
|
-
require 'cutword/get_string'
|
1
|
+
# lib/cutword.rb
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
else
|
11
|
-
text
|
12
|
-
end
|
13
|
-
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
|
14
9
|
end
|
15
10
|
end
|
16
|
-
|
metadata
CHANGED
@@ -1,24 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cutword
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.pre.alpha1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Demjhon Silver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: This gem provides
|
14
|
-
Rails
|
13
|
+
description: This gem provides string truncation and word cutting functionality for
|
14
|
+
both Rails and Hanami.
|
15
15
|
email: none
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
20
|
- lib/cutword.rb
|
21
|
-
- lib/cutword/get_string.rb
|
22
21
|
- lib/cutword/version.rb
|
23
22
|
homepage: https://github.com/demjhonsilver/cutword
|
24
23
|
licenses:
|
@@ -35,12 +34,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
35
34
|
version: '0'
|
36
35
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
|
-
- - "
|
37
|
+
- - ">"
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
39
|
+
version: 1.3.1
|
41
40
|
requirements: []
|
42
|
-
rubygems_version: 3.4.
|
41
|
+
rubygems_version: 3.4.10
|
43
42
|
signing_key:
|
44
43
|
specification_version: 4
|
45
|
-
summary: A simple gem for
|
44
|
+
summary: A simple gem for truncating words/strings or shortening words and names,
|
45
|
+
compatible with Rails and Hanami.
|
46
46
|
test_files: []
|