split_with_display_width 1.0.0 → 1.0.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9767b19d49220df197b1594ad5001d90415ca4e8
|
4
|
+
data.tar.gz: 61000844d20fab4e18ad39a8413c11bbfa07cbd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af59ac4f233687821d5e27f9e7c00f2ec86f45690b6a5b01b3f09a6927a76d1171844a06d63f1e80392704d53f1d52a32c682f16e60d41be073c5b523765555f
|
7
|
+
data.tar.gz: 9877db41df392c509a6b9f357fd649917e9936dd72939527f4232dd7620da1132b4fa7bd0b0d724bdd74bfc867ee87975e3b0a9b5f1754ab680db5119110120c
|
@@ -6,11 +6,13 @@ class String
|
|
6
6
|
|
7
7
|
first = []
|
8
8
|
second = []
|
9
|
+
flag = true
|
9
10
|
self.each_char.each do |char|
|
10
11
|
tmp = first + [char]
|
11
|
-
if tmp.join.display_width <= num
|
12
|
+
if tmp.join.display_width <= num && flag
|
12
13
|
first << char
|
13
14
|
else
|
15
|
+
flag = false
|
14
16
|
second << char
|
15
17
|
end
|
16
18
|
end
|
@@ -23,11 +25,13 @@ class String
|
|
23
25
|
|
24
26
|
first = []
|
25
27
|
second = []
|
28
|
+
flag = true
|
26
29
|
self.each_char.to_a.reverse.each do |char|
|
27
30
|
tmp = second + [char]
|
28
|
-
if tmp.join.display_width <= num
|
31
|
+
if tmp.join.display_width <= num && flag
|
29
32
|
second << char
|
30
33
|
else
|
34
|
+
flag = false
|
31
35
|
first << char
|
32
36
|
end
|
33
37
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: split_with_display_width
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nyaahara
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unicode-display_width
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- bin/setup
|
86
86
|
- lib/split_with_display_width.rb
|
87
87
|
- lib/split_with_display_width/version.rb
|
88
|
+
- split_with_display_width-1.0.0.gem
|
88
89
|
- split_with_display_width.gemspec
|
89
90
|
homepage: https://github.com/nyaahara/split_with_display_width
|
90
91
|
licenses:
|