helpline 0.1.8 → 0.1.13
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 +21 -15
- data/lib/helpline/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3d0d6469df1e6602a463e963d91e0bba1b627e2e7e08bb57ff74ec664bb1bac
|
4
|
+
data.tar.gz: 1559e82dc0f79050052a7dccef65e4a176e77fd6caefa12aa7f5db5f99a82041
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1645897171adc53bf7ee7042c9b2726720dca573c762dce8d34fd73ff4d6ec817b5f7e15dd5fe563c48b3f103113ce4dbdb150a6c857df507fbbe6b06aca9dcc
|
7
|
+
data.tar.gz: a30e309a07810fb870a7ddb3d9fdec1b0785fb7cdf8b65f79d39c832875f4f0a021745f03ef4407489dcb2b8cb6e9541bd36aa2351926f454c2a4e0d6f44b151
|
data/Makefile
CHANGED
data/exe/helpline
CHANGED
@@ -130,46 +130,48 @@ class HelpLine
|
|
130
130
|
#
|
131
131
|
# HelpLineエントリ
|
132
132
|
#
|
133
|
-
|
133
|
+
entries = []
|
134
134
|
data['defs'].each { |line|
|
135
135
|
if line =~ /^\s*\$\s*(.*)$/ # $....
|
136
|
-
|
136
|
+
entries << $1
|
137
137
|
elsif line =~ /^\s*\%\s*(.*)$/ # %....
|
138
138
|
cmd = $1
|
139
|
-
|
139
|
+
entries.each { |l|
|
140
140
|
desc = eval('"' + l + '"')
|
141
141
|
g.add desc.force_encoding('utf-8'), cmd.force_encoding('utf-8')
|
142
142
|
}
|
143
|
-
|
143
|
+
entries = []
|
144
144
|
end
|
145
145
|
}
|
146
146
|
|
147
|
-
# puts "GENERATE #{params.split('|').join(' ')} "
|
148
|
-
|
149
147
|
res = g.generate " #{ARGV.join(' ').sub(/\[/,'').sub(/\]/,'')} "
|
150
148
|
|
149
|
+
File.open("/tmp/helpline.cmd","w"){ |f|
|
150
|
+
f.puts ARGV.join(' ')
|
151
|
+
}
|
151
152
|
if res[0].length == 0
|
152
153
|
puts "ヘルプがみつかりません"
|
153
|
-
File.open("/tmp/helpline.cmd","w"){ |f|
|
154
|
-
f.puts ARGV.join(' ')
|
155
|
-
}
|
156
154
|
exit
|
157
155
|
end
|
158
156
|
|
157
|
+
git_repository = File.exist?(".git")
|
159
158
|
listed = {}
|
160
159
|
list = res[0].find_all { |a| # 0 ambig
|
161
160
|
# a = ["現在の状況を表示する {56}", "git status {56}"], etc.
|
162
|
-
if
|
161
|
+
if a[0] =~ /^git:/ && !git_repository
|
163
162
|
false
|
164
163
|
else
|
165
|
-
listed[a[1]]
|
164
|
+
if listed[a[1]]
|
165
|
+
false
|
166
|
+
else
|
167
|
+
listed[a[1]] = true
|
168
|
+
end
|
166
169
|
end
|
167
170
|
}
|
168
171
|
|
169
172
|
#
|
170
173
|
# HelpLineメニュー表示し、カーソル移動で選択
|
171
174
|
#
|
172
|
-
|
173
175
|
help_number = {}
|
174
176
|
list.each_with_index { |entry,ind|
|
175
177
|
entry[0].sub!(/\s*{(\d*)}$/,'')
|
@@ -180,6 +182,9 @@ class HelpLine
|
|
180
182
|
sel = 0
|
181
183
|
disp(list,sel)
|
182
184
|
|
185
|
+
lines = list.length
|
186
|
+
lines = LINES if lines > LINES
|
187
|
+
|
183
188
|
inputchars = ''
|
184
189
|
while true
|
185
190
|
c = STDIN.getch
|
@@ -197,7 +202,7 @@ class HelpLine
|
|
197
202
|
inputchars = ''
|
198
203
|
elsif inputchars == "\x0e" || inputchars == "\e[B" || inputchars == "\eOB"
|
199
204
|
Curses.down
|
200
|
-
sel = (sel + 1) if sel <
|
205
|
+
sel = (sel + 1) if sel < lines-1
|
201
206
|
inputchars = ''
|
202
207
|
elsif inputchars == "\x10" || inputchars == "\e[A" || inputchars == "\eOA"
|
203
208
|
Curses.up
|
@@ -219,10 +224,11 @@ class HelpLine
|
|
219
224
|
desc = list[sel.to_i][0]
|
220
225
|
cmd = list[sel][1]
|
221
226
|
|
222
|
-
Curses.move(lines
|
227
|
+
Curses.move(lines,0)
|
228
|
+
Curses.tol
|
229
|
+
|
223
230
|
#Curses.move(0,0)
|
224
231
|
##Curses.down
|
225
|
-
##Curses.tol
|
226
232
|
Curses.print_inverse("「#{desc}」を実行")
|
227
233
|
puts " (ソース: http://scrapbox.io/HelpLine/#{data['pages'][help_number[desc]]})"
|
228
234
|
File.open("/tmp/helpline.cmd","w"){ |f|
|
data/lib/helpline/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helpline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshiyuki Masui
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|