cutword 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 510a9a70abf15f6ca27352a10d654dc2f5124f079ef2419b39a34c8bfbb5f8b2
4
+ data.tar.gz: 121481cb723b6a19a16e524befa29bc21f6fd2b065075525fa2da4aa8aad1d81
5
+ SHA512:
6
+ metadata.gz: 192571094b005532fa1a77421cab257b54f9208656f201490bec3560fe7baa2c9c82f3f58dcc3b0c9bebfab1e65270045a176daf079576ac51b745757a7bd089
7
+ data.tar.gz: 3eba0ff5269ea980b9e2d0a3e94b110bcd3914d957b45b0c84c77d6df10ccbab6f73731d401fa67522ef716628fe0859589f3c80caec9d95a29546ba6530cc8e
@@ -0,0 +1,12 @@
1
+ module Cutword
2
+ class << self
3
+ def slicer(text, max_length)
4
+ if text.length > max_length
5
+ text[0...max_length] + '...'
6
+ else
7
+ text
8
+ end
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,3 @@
1
+ module Cutword
2
+ VERSION = '0.1.0'.freeze
3
+ end
data/lib/cutword.rb ADDED
@@ -0,0 +1,14 @@
1
+ require 'cutword/version'
2
+ require 'cutword/string_slicer'
3
+
4
+ module Cutword
5
+ class << self
6
+ def slicer(text, max_length)
7
+ if text.length > max_length
8
+ text[0...max_length] + '...'
9
+ else
10
+ text
11
+ end
12
+ end
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cutword
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Demjhon Silver
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-10-03 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: This gem provides a string truncation/cut words method for Ruby on Rails
14
+ applications.
15
+ email: none
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/cutword.rb
21
+ - lib/cutword/string_slicer.rb
22
+ - lib/cutword/version.rb
23
+ homepage: https://github.com/demjhonsilver/cutword
24
+ licenses:
25
+ - MIT
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubygems_version: 3.4.10
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: A simple gem for cut words/string truncation in Ruby on Rails.
46
+ test_files: []