helpline 0.1.7 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4796cced1ca30fb1effb576492307234872655a7fbc7daa4581c5f8cf3deb1c4
4
- data.tar.gz: 9765b91769a092835c9f2c9d42fd2de068cdc9eb4119b5f0a6f08ea8bbf04d54
3
+ metadata.gz: bf6546d695b0f5183a37b1bd3f03b92badd158baf1b41de47710cd5620d1fe25
4
+ data.tar.gz: 8c66e7379d9cb8e2d02925fb80a33e44d9772fb6d40bcb41e0ec681e6c92092c
5
5
  SHA512:
6
- metadata.gz: 0f2b9ea43201159fddb09c7b9b3f51f5f514037a9b9d0d6c5928f241acf4b8d11198cd9d4b9dc1fcb0bfbbe8294d9f274a78f7ae27352f57d3143dd4cd860236
7
- data.tar.gz: a0b7b42b1b39b92a5db2025d192215af4be319b16e51386a9e75ebbe9ff078c9a02750cb91d6108f047201c1d1e556c4100e4541b9a2e6d14642fd8d86705d61
6
+ metadata.gz: 289c5a0bc28dd19cbfe0f25bcfc3d32776c7b4e9dcba21b763d6cd72dfa0425f09efc2de9758dd57025338e90e6115f336562700d4117adae27d44d27d109fa8
7
+ data.tar.gz: e9455987872ac5e3765703bf7f13cc204a22b1d5c237970943ff99c3d2bffe53a7e3b815cbf7df222bee1fad1e1fee45c21dfcb6276a917439ba672b4c5e842c
data/Makefile CHANGED
@@ -42,3 +42,12 @@ clean:
42
42
 
43
43
  all: update build-mac
44
44
 
45
+
46
+ #
47
+ # gem
48
+ #
49
+ release:
50
+ rake release
51
+
52
+
53
+
@@ -130,22 +130,20 @@ class HelpLine
130
130
  #
131
131
  # HelpLineエントリ
132
132
  #
133
- lines = []
133
+ entries = []
134
134
  data['defs'].each { |line|
135
135
  if line =~ /^\s*\$\s*(.*)$/ # $....
136
- lines << $1
136
+ entries << $1
137
137
  elsif line =~ /^\s*\%\s*(.*)$/ # %....
138
138
  cmd = $1
139
- lines.each { |l|
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
- lines = []
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
 
151
149
  if res[0].length == 0
@@ -156,13 +154,18 @@ class HelpLine
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 listed[a[1]]
161
+ if a[0] =~ /^git:/ && !git_repository
163
162
  false
164
163
  else
165
- listed[a[1]] = true
164
+ if listed[a[1]]
165
+ false
166
+ else
167
+ listed[a[1]] = true
168
+ end
166
169
  end
167
170
  }
168
171
 
@@ -180,6 +183,9 @@ class HelpLine
180
183
  sel = 0
181
184
  disp(list,sel)
182
185
 
186
+ lines = list.length
187
+ lines = LINES if lines > LINES
188
+
183
189
  inputchars = ''
184
190
  while true
185
191
  c = STDIN.getch
@@ -197,7 +203,7 @@ class HelpLine
197
203
  inputchars = ''
198
204
  elsif inputchars == "\x0e" || inputchars == "\e[B" || inputchars == "\eOB"
199
205
  Curses.down
200
- sel = (sel + 1) if sel < LINES-1
206
+ sel = (sel + 1) if sel < lines-1
201
207
  inputchars = ''
202
208
  elsif inputchars == "\x10" || inputchars == "\e[A" || inputchars == "\eOA"
203
209
  Curses.up
@@ -219,6 +225,11 @@ class HelpLine
219
225
  desc = list[sel.to_i][0]
220
226
  cmd = list[sel][1]
221
227
 
228
+ Curses.move(lines,0)
229
+ Curses.tol
230
+
231
+ #Curses.move(0,0)
232
+ ##Curses.down
222
233
  Curses.print_inverse("「#{desc}」を実行")
223
234
  puts " (ソース: http://scrapbox.io/HelpLine/#{data['pages'][help_number[desc]]})"
224
235
  File.open("/tmp/helpline.cmd","w"){ |f|
@@ -1,3 +1,3 @@
1
1
  module Helpline
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.12"
3
3
  end
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.7
4
+ version: 0.1.12
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-03 00:00:00.000000000 Z
11
+ date: 2020-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler