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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 199a540076326f10851cfc795361210cecfdfdad48a76f1e9f0e6e0452157d76
4
- data.tar.gz: e63632a8ba506b8de4eef22e7394c9dfe103d7c7e419d9fb55f1ab7522dd5251
3
+ metadata.gz: 3f7e9a8fcd185e1ec47ec3a222413f9b828537791e1f026ef5f7442d236909c8
4
+ data.tar.gz: 59482810eeb3180668222ae9b51f1a74ed12982ef3c9cad8c2ffcc261629852d
5
5
  SHA512:
6
- metadata.gz: b3f4880c7319f1bd6b2cb60b6e0073b4ba280c8ea02da3ec5df4dbc620d068c96cfecbefa5ba83d405de6613c7275542cc6325b098145cbe740988321735111b
7
- data.tar.gz: 1b53266d6711324dde744d3ff18d13b28172d1e150895b7fc0bf34c633080afd98f2318a11f18ac7496945d5ca421230ea309d98580fda215573e7c771974daf
6
+ metadata.gz: 4a98830366a52b60c84a4bd1726934c86c14a05411b0a5279a88fca62f0996d0e0dac8db50e8ba4c84d521eb6eb20516d0f43966e580ed4bfb9756db38d56b19
7
+ data.tar.gz: a3351559f6c7d253ed6a13d4689edab9809f9e2049dd850e0e3812dbe157e7a5075f3ee73f6f0adfb5628f330987ce6425621e80b3edc8b88561056383be307c
@@ -1,3 +1,3 @@
1
1
  module Cutword
2
- VERSION = '2.0.0-alpha1'
2
+ VERSION = '2.0.0-alpha2'
3
3
  end
data/lib/cutword.rb CHANGED
@@ -1,10 +1,16 @@
1
1
  # lib/cutword.rb
2
2
 
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
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.alpha1
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: '0'
34
+ version: 3.0.0
35
35
  required_rubygems_version: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">"