helpline 0.1.6 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +9 -0
- data/exe/helpline +17 -8
- data/lib/helpline/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: 68594071f2e4aa5818d9ae6de52c5ee62639d1f515ff57ac2e99651db55c9926
|
4
|
+
data.tar.gz: 795c0e29cec0c2f64f322dba73489e8be0886e9fb2f37c6ec8a844ab66fa6f3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 337bdaff283898d910d81beadd934816f3402151b894c61e5e4c862f60b44a0731b81411ae9312354b29fbe752b0836356e1accbef1c9e4c25067574d16eed1b
|
7
|
+
data.tar.gz: e6fc6bfee04155eed4cdfa9e17ca61757a1a63a9ec94b6af78afea0409ee21d119d3d0223cbfcd8e7136e7f2ce8bc397784fc60a6ad5afdadb9802f4bc5906bf
|
data/Makefile
CHANGED
data/exe/helpline
CHANGED
@@ -99,15 +99,16 @@ class HelpLine
|
|
99
99
|
lines = LINES if lines > LINES
|
100
100
|
(0...lines).each { |i|
|
101
101
|
Curses.move(i,0)
|
102
|
-
s = "
|
102
|
+
s = "* #{list[i][0]}"
|
103
103
|
if i == sel
|
104
104
|
Curses.print_inverse s
|
105
105
|
else
|
106
106
|
Curses.print s
|
107
107
|
end
|
108
108
|
}
|
109
|
-
Curses.
|
110
|
-
Curses.
|
109
|
+
Curses.move(sel,0)
|
110
|
+
# Curses.down
|
111
|
+
# Curses.tol
|
111
112
|
end
|
112
113
|
|
113
114
|
def helpline
|
@@ -129,17 +130,17 @@ class HelpLine
|
|
129
130
|
#
|
130
131
|
# HelpLineエントリ
|
131
132
|
#
|
132
|
-
|
133
|
+
entries = []
|
133
134
|
data['defs'].each { |line|
|
134
135
|
if line =~ /^\s*\$\s*(.*)$/ # $....
|
135
|
-
|
136
|
+
entries << $1
|
136
137
|
elsif line =~ /^\s*\%\s*(.*)$/ # %....
|
137
138
|
cmd = $1
|
138
|
-
|
139
|
+
entries.each { |l|
|
139
140
|
desc = eval('"' + l + '"')
|
140
141
|
g.add desc.force_encoding('utf-8'), cmd.force_encoding('utf-8')
|
141
142
|
}
|
142
|
-
|
143
|
+
entries = []
|
143
144
|
end
|
144
145
|
}
|
145
146
|
|
@@ -179,6 +180,9 @@ class HelpLine
|
|
179
180
|
sel = 0
|
180
181
|
disp(list,sel)
|
181
182
|
|
183
|
+
lines = list.length
|
184
|
+
lines = LINES if lines > LINES
|
185
|
+
|
182
186
|
inputchars = ''
|
183
187
|
while true
|
184
188
|
c = STDIN.getch
|
@@ -196,7 +200,7 @@ class HelpLine
|
|
196
200
|
inputchars = ''
|
197
201
|
elsif inputchars == "\x0e" || inputchars == "\e[B" || inputchars == "\eOB"
|
198
202
|
Curses.down
|
199
|
-
sel = (sel + 1) if sel <
|
203
|
+
sel = (sel + 1) if sel < lines-1
|
200
204
|
inputchars = ''
|
201
205
|
elsif inputchars == "\x10" || inputchars == "\e[A" || inputchars == "\eOA"
|
202
206
|
Curses.up
|
@@ -218,6 +222,11 @@ class HelpLine
|
|
218
222
|
desc = list[sel.to_i][0]
|
219
223
|
cmd = list[sel][1]
|
220
224
|
|
225
|
+
Curses.move(lines,0)
|
226
|
+
Curses.tol
|
227
|
+
|
228
|
+
#Curses.move(0,0)
|
229
|
+
##Curses.down
|
221
230
|
Curses.print_inverse("「#{desc}」を実行")
|
222
231
|
puts " (ソース: http://scrapbox.io/HelpLine/#{data['pages'][help_number[desc]]})"
|
223
232
|
File.open("/tmp/helpline.cmd","w"){ |f|
|
data/lib/helpline/version.rb
CHANGED