my_help 1.2.7 → 1.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/my_help/list.rb +8 -9
- data/lib/my_help/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3194975e829d7fbb8daad82df834fd8a099a4aa5123be744a10fb60cc2cbf79f
|
4
|
+
data.tar.gz: 1e4023bdc4823e9c6c648412a380af584eb322fd1f5df73ed6f774db8fe247b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e76173eca3a142bf25d7d28b7867d038e131ca7f00650c36ca17abd3a98a0373759fcb3e348c9cedd426d5d43db4971ead8837e950eea3a0e34a0443bbe8db2
|
7
|
+
data.tar.gz: 489b68bc28669f05bff539f3cc34fef7b5df7554b898506c96f8039138fd357e398b68e5dcd85e650e81f6633d248f57f94627891d521fb324ef2cc4c8030aa0
|
data/lib/my_help/list.rb
CHANGED
@@ -37,18 +37,17 @@ module MyHelp
|
|
37
37
|
head = help_info[:items]["head"] ?
|
38
38
|
help_info[:items]["head"].split("\n")[0] : ''
|
39
39
|
# "head "ではだめ...やれやれ<24/10/02> revised
|
40
|
-
out << "%10s: %s\n" % [help_info[:name], head]
|
40
|
+
# out << "%10s: %s\n" % [help_info[:name], head]
|
41
41
|
# out << "%s: %s\n" % [help_info[:name], head]
|
42
|
-
|
42
|
+
out << "%s: %s\n" % [pad_with_bytes(help_info[:name],20), head]
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
46
|
def pad_with_bytes(str, length, padstr=" ")
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
exit
|
47
|
+
str_bytes = str.each_char.map do |c|
|
48
|
+
c.bytesize == 1 ? 1 : 2
|
49
|
+
end.reduce(0, &:+)
|
50
|
+
pad = padstr * (length - str_bytes)
|
52
51
|
return pad + str
|
53
52
|
end
|
54
53
|
|
@@ -63,8 +62,8 @@ module MyHelp
|
|
63
62
|
@help_info[:items].each_pair do |item, val|
|
64
63
|
item, desc = item.split(":")
|
65
64
|
desc ||= ""
|
66
|
-
output << "- %20s : %s\n" % [item, desc]
|
67
|
-
|
65
|
+
# output << "- %20s : %s\n" % [item, desc]
|
66
|
+
output << "%s: %s\n" % [pad_with_bytes(item, 20), desc]
|
68
67
|
end
|
69
68
|
else
|
70
69
|
output << find_near(item)
|
data/lib/my_help/version.rb
CHANGED