hilfer 0.11.5 → 0.11.7
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/README.txt +1 -0
- data/lib/hilfer/rails_locator.rb +4 -0
- data/lib/hilfer/scite_editor.rb +34 -32
- data/lib/hilfer/version.rb +1 -1
- metadata +36 -40
data/History.txt
CHANGED
data/README.txt
CHANGED
data/lib/hilfer/rails_locator.rb
CHANGED
@@ -140,6 +140,10 @@ class RailsLocator
|
|
140
140
|
when event.hardware_keycode == 32 && event.state.control_mask? && event.state.shift_mask?
|
141
141
|
goto_rails_path '/config'
|
142
142
|
|
143
|
+
# Shift-Ctrl-U - go to routes.rb
|
144
|
+
when event.hardware_keycode == 30 && event.state.control_mask? && event.state.shift_mask?
|
145
|
+
goto_rails_path '/config/routes.rb'
|
146
|
+
|
143
147
|
# Shift-Ctrl-S - go to stylesheets
|
144
148
|
when event.hardware_keycode == 39 && event.state.control_mask? && event.state.shift_mask?
|
145
149
|
goto_rails_path '/public/stylesheets'
|
data/lib/hilfer/scite_editor.rb
CHANGED
@@ -8,49 +8,49 @@ class SciteEditor
|
|
8
8
|
def initialize( options = {} )
|
9
9
|
# commands to scite are sent here
|
10
10
|
@scite_pipe_name = "/tmp/hilfer.#{ENV['USER']}.#{Process.pid}.scite"
|
11
|
-
|
11
|
+
|
12
12
|
# commands from scite arrive here
|
13
13
|
@director_pipe_name = "/tmp/hilfer.#{ENV['USER']}.#{Process.pid}.director"
|
14
14
|
@pipe_name_file = "/tmp/hilfer.#{ENV['USER']}.scite"
|
15
|
-
|
15
|
+
|
16
16
|
cleanup
|
17
|
-
|
17
|
+
|
18
18
|
# this is an array of TreeViewer objects
|
19
19
|
@views = []
|
20
20
|
# the command-line options
|
21
21
|
@options = options
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
24
|
attr_reader :options
|
25
25
|
attr_reader :scite_pid
|
26
26
|
attr_reader :pipe_name_file
|
27
|
-
|
27
|
+
|
28
28
|
def debug?
|
29
29
|
@options[:debug]
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
def launched?
|
33
33
|
!@scite_pid.nil?
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
# return a Window object for the editor.
|
37
37
|
def window
|
38
38
|
@window ||= Window.pid( @scite_pid )
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
def reset
|
42
42
|
@scite_pid = nil
|
43
43
|
@window = nil
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
def kill
|
47
47
|
`kill #{@scite_pid}`
|
48
48
|
reset
|
49
49
|
cleanup
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
def cleanup
|
53
|
-
FileUtils.rm @scite_pipe_name if File.exist? @scite_pipe_name
|
53
|
+
FileUtils.rm @scite_pipe_name if File.exist? @scite_pipe_name
|
54
54
|
FileUtils.rm @director_pipe_name if File.exist? @director_pipe_name
|
55
55
|
FileUtils.rm pipe_name_file if File.exist? pipe_name_file
|
56
56
|
end
|
@@ -63,7 +63,7 @@ class SciteEditor
|
|
63
63
|
file.puts "#{cmd.to_s}:#{arg.to_s}"
|
64
64
|
end
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
67
|
# bring the SciTE instance to the current
|
68
68
|
# desktop and raise it.
|
69
69
|
def activate
|
@@ -80,7 +80,7 @@ class SciteEditor
|
|
80
80
|
#~ send_cmd :identity, 0
|
81
81
|
activate
|
82
82
|
end
|
83
|
-
|
83
|
+
|
84
84
|
def dump
|
85
85
|
%w{dyn local user base embed}.each {|x| send_cmd 'enumproperties', x}
|
86
86
|
#~ send_cmd 'askproperty','dyn:CurrentWord'
|
@@ -90,13 +90,13 @@ class SciteEditor
|
|
90
90
|
def synchronize_path
|
91
91
|
send_cmd :askfilename
|
92
92
|
end
|
93
|
-
|
93
|
+
|
94
94
|
# shut down editor, if it's open
|
95
95
|
def quit
|
96
96
|
# check for launched?, otherwise send_cmd will attempt to auto-launch.
|
97
97
|
send_cmd :quit if launched?
|
98
98
|
end
|
99
|
-
|
99
|
+
|
100
100
|
# insert text to editor, at current caret, or overwriting the current selection
|
101
101
|
def insert( arg )
|
102
102
|
value =
|
@@ -121,7 +121,7 @@ class SciteEditor
|
|
121
121
|
def unregister_view( view )
|
122
122
|
@views.delete( view )
|
123
123
|
end
|
124
|
-
|
124
|
+
|
125
125
|
def write_pipe_name
|
126
126
|
File.open( pipe_name_file, 'w' ) do |f|
|
127
127
|
f.write @scite_pipe_name
|
@@ -135,14 +135,14 @@ class SciteEditor
|
|
135
135
|
# other things. Will also install a handler for SIGCHLD
|
136
136
|
def launch
|
137
137
|
return if launched?
|
138
|
-
|
138
|
+
|
139
139
|
# create the director pipe if it isn't there already
|
140
140
|
unless File.exists?( @director_pipe_name )
|
141
141
|
system( "mkfifo #{@director_pipe_name}" )
|
142
142
|
end
|
143
|
-
|
143
|
+
|
144
144
|
scite_cmd = "/usr/bin/scite"
|
145
|
-
|
145
|
+
|
146
146
|
# wait for scite shutdown by SIGCHLD, and clean up fifo files.
|
147
147
|
@handler ||= trap( "CHLD" ) do |signal|
|
148
148
|
child_pid = Process.wait( -1, Process::WNOHANG )
|
@@ -156,7 +156,7 @@ class SciteEditor
|
|
156
156
|
puts "finished cleaning pipes" if debug?
|
157
157
|
end
|
158
158
|
end
|
159
|
-
|
159
|
+
|
160
160
|
# fork and exec scite, so we can get scite's pid
|
161
161
|
if ( @scite_pid = fork() ).nil?
|
162
162
|
puts "in child" if debug?
|
@@ -169,25 +169,25 @@ class SciteEditor
|
|
169
169
|
"-ipc.scite.name=#{@scite_pipe_name}"
|
170
170
|
)
|
171
171
|
end
|
172
|
-
|
172
|
+
|
173
173
|
puts "in parent: scite launched with pid #{@scite_pid}" if debug?
|
174
|
-
|
174
|
+
|
175
175
|
# listen for incoming scite events, like file change and open
|
176
176
|
start_listener
|
177
177
|
end
|
178
|
-
|
178
|
+
|
179
179
|
protected
|
180
|
-
|
180
|
+
|
181
181
|
def start_listener
|
182
182
|
# wait for scite pipe otherwise scite sometimes hangs and
|
183
183
|
# doesn't receive open requests
|
184
184
|
sleep 0.1 while !File.exists? @scite_pipe_name
|
185
185
|
puts "#{@scite_pipe_name} exists" if debug?
|
186
|
-
|
186
|
+
|
187
187
|
# wait for director pipe as well
|
188
188
|
sleep 0.1 while !File.exists? @director_pipe_name
|
189
189
|
puts "#{@director_pipe_name} exists" if debug?
|
190
|
-
|
190
|
+
|
191
191
|
Thread.new do
|
192
192
|
begin
|
193
193
|
listen
|
@@ -198,9 +198,9 @@ protected
|
|
198
198
|
puts e.backtrace
|
199
199
|
end
|
200
200
|
end
|
201
|
-
|
201
|
+
|
202
202
|
end
|
203
|
-
|
203
|
+
|
204
204
|
def react( line )
|
205
205
|
puts "reacting to #{line}" if debug?
|
206
206
|
case line
|
@@ -219,9 +219,11 @@ protected
|
|
219
219
|
# the specified file has just been saved. Do nothing.
|
220
220
|
# TODO could check that it exists and add it if not.
|
221
221
|
when /^saved:(.*)$/
|
222
|
-
|
223
|
-
|
224
|
-
|
222
|
+
|
223
|
+
# TODO could add to history list
|
224
|
+
when /^closed:(.*)$/
|
225
|
+
|
226
|
+
when /^closing:$/
|
225
227
|
|
226
228
|
# print it out
|
227
229
|
else
|
@@ -243,7 +245,7 @@ protected
|
|
243
245
|
puts "caught Exception in listen: #{e.inspect}"
|
244
246
|
puts e.backtrace
|
245
247
|
end
|
246
|
-
|
248
|
+
|
247
249
|
# doesn't work with scite 2.x
|
248
250
|
def block_listen
|
249
251
|
File.open( @director_pipe_name ).each( "\x0" ) do |line|
|
data/lib/hilfer/version.rb
CHANGED
metadata
CHANGED
@@ -1,51 +1,49 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: hilfer
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.11.7
|
4
5
|
prerelease:
|
5
|
-
version: 0.11.5
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- John Anderson
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-10-09 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: gtk2
|
17
|
-
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &82581120 !ruby/object:Gem::Requirement
|
19
17
|
none: false
|
20
|
-
requirements:
|
18
|
+
requirements:
|
21
19
|
- - ~>
|
22
|
-
- !ruby/object:Gem::Version
|
20
|
+
- !ruby/object:Gem::Version
|
23
21
|
version: 1.0.0
|
24
22
|
type: :runtime
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: bones
|
28
23
|
prerelease: false
|
29
|
-
|
24
|
+
version_requirements: *82581120
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: bones
|
27
|
+
requirement: &82580360 !ruby/object:Gem::Requirement
|
30
28
|
none: false
|
31
|
-
requirements:
|
32
|
-
- -
|
33
|
-
- !ruby/object:Gem::Version
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
34
32
|
version: 3.7.0
|
35
33
|
type: :development
|
36
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *82580360
|
37
36
|
description: Programmers file browser for SciTE
|
38
37
|
email: panic@semiosix.com
|
39
|
-
executables:
|
38
|
+
executables:
|
40
39
|
- hilfer
|
41
40
|
- ssc
|
42
41
|
extensions: []
|
43
|
-
|
44
|
-
extra_rdoc_files:
|
42
|
+
extra_rdoc_files:
|
45
43
|
- History.txt
|
46
44
|
- README.txt
|
47
45
|
- TODO
|
48
|
-
files:
|
46
|
+
files:
|
49
47
|
- History.txt
|
50
48
|
- Manifest.txt
|
51
49
|
- README.txt
|
@@ -71,33 +69,31 @@ files:
|
|
71
69
|
- test/test_key_matcher.rb
|
72
70
|
homepage: http://hilfer.rubyforge.org/hilfer
|
73
71
|
licenses: []
|
74
|
-
|
75
72
|
post_install_message:
|
76
|
-
rdoc_options:
|
73
|
+
rdoc_options:
|
77
74
|
- -W
|
78
75
|
- http://gitweb.semiosix.com/hilfer.cgi?p=clevic;a=blob;f=%s;hb=HEAD
|
79
76
|
- --main
|
80
77
|
- README.txt
|
81
|
-
require_paths:
|
78
|
+
require_paths:
|
82
79
|
- lib
|
83
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
81
|
none: false
|
85
|
-
requirements:
|
86
|
-
- -
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version:
|
89
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
87
|
none: false
|
91
|
-
requirements:
|
92
|
-
- -
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version:
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
95
92
|
requirements: []
|
96
|
-
|
97
93
|
rubyforge_project: hilfer
|
98
|
-
rubygems_version: 1.
|
94
|
+
rubygems_version: 1.8.10
|
99
95
|
signing_key:
|
100
96
|
specification_version: 3
|
101
97
|
summary: http://www.
|
102
|
-
test_files:
|
98
|
+
test_files:
|
103
99
|
- test/test_key_matcher.rb
|