cutword 0.1.0 → 1.0.0.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/get_string.rb +12 -0
- data/lib/cutword/version.rb +1 -1
- data/lib/cutword.rb +12 -10
- metadata +6 -6
- data/lib/cutword/string_slicer.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: 27719e079601b954bb80ca7e8370d4d5b02403c28a1dd455ac8940623d8d98ba
|
4
|
+
data.tar.gz: 020f4072438c8ce6ec495c4bf3a9cde0394a97b5a0a79d7583555676124a650f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 441480882066cee1c48942cbb3a1e0d2eb72dd237e003ac0f671651853a14c3b87312f77c60e72f9a25b8cf7528db11aa67c0aa481939cf6bdb169304b391d0f
|
7
|
+
data.tar.gz: a5dd7126c77d593dad59a95320ee52bee215374ebb5fa0aa69d8629749d24101b347fadf6ec0fc36c9be889db1af628aa7e3c888b72298b99883e258ab7e0190
|
data/lib/cutword/version.rb
CHANGED
data/lib/cutword.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
require 'cutword/version'
|
2
|
-
require 'cutword/
|
2
|
+
require 'cutword/get_string'
|
3
3
|
|
4
4
|
module Cutword
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
class << self
|
6
|
+
def get(text, max_length)
|
7
|
+
if text.length > max_length
|
8
|
+
truncated_text = text[0...max_length - 3].strip
|
9
|
+
truncated_text + '...'
|
10
|
+
else
|
11
|
+
text
|
12
|
+
end
|
13
13
|
end
|
14
|
-
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cutword
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0.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: 2023-10-
|
11
|
+
date: 2023-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This gem provides a string truncation/cut words method for Ruby on Rails
|
14
14
|
applications.
|
@@ -18,7 +18,7 @@ extensions: []
|
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
20
|
- lib/cutword.rb
|
21
|
-
- lib/cutword/
|
21
|
+
- lib/cutword/get_string.rb
|
22
22
|
- lib/cutword/version.rb
|
23
23
|
homepage: https://github.com/demjhonsilver/cutword
|
24
24
|
licenses:
|
@@ -35,11 +35,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
35
35
|
version: '0'
|
36
36
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.3.1
|
41
41
|
requirements: []
|
42
|
-
rubygems_version: 3.4.
|
42
|
+
rubygems_version: 3.4.20
|
43
43
|
signing_key:
|
44
44
|
specification_version: 4
|
45
45
|
summary: A simple gem for cut words/string truncation in Ruby on Rails.
|