helpline 0.1.5 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/exe/helpline +17 -9
  3. data/lib/helpline/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e2b93dc79e46d3eeb5f2867f20f42d1e188aecf6e81128b9819d01f97e65132
4
- data.tar.gz: 18d0062e75b35b3dc88ca362818928e2ba456996fd1dd48a3383a5ba1c0a8ac4
3
+ metadata.gz: df4abe21c7cf0fa6b4cbab29c3508a07afdb64ffec34dd747ddd3196a189e1b6
4
+ data.tar.gz: 6603ebc12c5776eceee14a972be5300036b69568412b22d83cd9b60a24475aec
5
5
  SHA512:
6
- metadata.gz: 6610decc65beb0c5bbfd1a05075ed6e77f4f0ab18a96ae6f6c9c7584d145ce27499f1c318679a083ca1105a52d8ebac855c04398dc8f9e62722cbb940e6510d4
7
- data.tar.gz: ae28a2b29a2aa21a06e758ecd38fa280411f3f62ea38bb070c9cc63bb3f6b3e5fbfe015fc180264666b0557978c932c210c45a34731dd50457ee6c64c88a5f8b
6
+ metadata.gz: 9a2050e3b6b9892236744689bedae81c256c0a546c21efbfcc0f35eea76e351e7cb9859e3f7aa399cf6a8bec4ad7536d578a550fc2a5ffbe29e032563a027a87
7
+ data.tar.gz: 4b625cbc5295c6f78ff40e516b78a8be0ae654ecbad4e2844cc072aa7b1d93dedaaafcfbe1ff1a8d13904b7f0b7349ae84a5335a69cd6f190c722c9061cb9db1
@@ -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 = "[#{i}] #{list[i][0]}"
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.down
110
- Curses.tol
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
- lines = []
133
+ entries = []
133
134
  data['defs'].each { |line|
134
135
  if line =~ /^\s*\$\s*(.*)$/ # $....
135
- lines << $1
136
+ entries << $1
136
137
  elsif line =~ /^\s*\%\s*(.*)$/ # %....
137
138
  cmd = $1
138
- lines.each { |l|
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
- lines = []
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 < LINES-1
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,9 +222,13 @@ 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.move(0,0)
227
+ ##Curses.down
228
+ ##Curses.tol
221
229
  Curses.print_inverse("「#{desc}」を実行")
222
230
  puts " (ソース: http://scrapbox.io/HelpLine/#{data['pages'][help_number[desc]]})"
223
- File.open("/tmp/helpline","w"){ |f|
231
+ File.open("/tmp/helpline.cmd","w"){ |f|
224
232
  f.puts cmd
225
233
  }
226
234
  end
@@ -1,3 +1,3 @@
1
1
  module Helpline
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helpline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshiyuki Masui