hilfer 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,6 +1,163 @@
1
- === 0.1.1 / 2008-03-10
1
+ 2008-04-01 15:31 panic
2
2
 
3
- * package as Gem using Hoe
3
+ * [r3451] trunk, trunk/History.txt, trunk/Manifest.txt,
4
+ trunk/README.txt, trunk/Rakefile, trunk/TODO,
5
+ trunk/bin/hilfer-icon.png, trunk/lib/hilfer/hilfer-icon.png,
6
+ trunk/lib/hilfer/scite_editor.rb,
7
+ trunk/lib/hilfer/svn_colours.rb:
8
+ documentation
4
9
 
5
- * yes, really.
10
+ 2008-04-01 14:45 panic
11
+
12
+ * [r3450] trunk/ext:
13
+ remove old bash files
14
+ * [r3449] trunk/Manifest.txt, trunk/README.txt, trunk/Rakefile,
15
+ trunk/bin/ssc, trunk/ext/Rakefile, trunk/ext/bin/ec,
16
+ trunk/ext/bin/sd:
17
+ add ssc. Rakefile for ext/bin
18
+
19
+ 2008-04-01 09:38 panic
20
+
21
+ * [r3448] trunk/bin/hilfer, trunk/lib/hilfer/scite_editor.rb:
22
+ fix scite quitting
23
+
24
+ 2008-03-31 19:54 panic
25
+
26
+ * [r3446] trunk/ext, trunk/ext/bin, trunk/ext/bin/ec,
27
+ trunk/ext/bin/sd, trunk/ext/ec, trunk/ext/extconf.rb,
28
+ trunk/ext/sd, trunk/ext/setup.rb:
29
+ first attempt at installing bash scripts
30
+
31
+ 2008-03-31 19:17 panic
32
+
33
+ * [r3445] trunk/Rakefile, trunk/TODO, trunk/bin/ec, trunk/bin/sd,
34
+ trunk/ext, trunk/ext/ec, trunk/ext/extconf.rb, trunk/ext/sd,
35
+ trunk/extconf.rb:
36
+ create ext dir for bash scripts
37
+
38
+ 2008-03-31 15:17 panic
39
+
40
+ * [r3444] trunk/Rakefile:
41
+ bump version
42
+
43
+ 2008-03-31 15:16 panic
44
+
45
+ * [r3443] trunk/Rakefile, trunk/TODO, trunk/bin/hilfer,
46
+ trunk/dev/listen.rb, trunk/lib/hilfer/scite_editor.rb,
47
+ trunk/lib/hilfer/tree_viewer.rb:
48
+ copy files to editor. Improve cleanup. Option to quit editor on
49
+ close. Relative paths for paste.
50
+
51
+ 2008-03-31 12:22 panic
52
+
53
+ * [r3442] trunk/Manifest.txt:
54
+ add svn_colours
55
+ * [r3441] trunk/bin/ed:
56
+ remove
57
+
58
+ 2008-03-31 12:21 panic
59
+
60
+ * [r3440] trunk/bin/hilfer:
61
+ remove tabs
62
+ make sure app operates without the icon
63
+
64
+ 2008-03-31 12:20 panic
65
+
66
+ * [r3439] trunk/lib/hilfer/tree_viewer.rb:
67
+ make sure Ctrl-Enter on a top-level file doesn't cause crash
68
+
69
+ 2008-03-31 12:19 panic
70
+
71
+ * [r3438] trunk/Rakefile:
72
+ remove commented lines
73
+ add a run and an irb task
74
+
75
+ 2008-03-10 21:14 panic
76
+
77
+ * [r3389] trunk/TODO:
78
+ done
79
+
80
+ 2008-03-10 21:05 panic
81
+
82
+ * [r3388] trunk/History.txt, trunk/Manifest.txt, trunk/README.txt,
83
+ trunk/Rakefile, trunk/bin/hilfer, trunk/bin/hilfer-icon.png,
84
+ trunk/lib/hilfer/hilfer-icon.png, trunk/lib/hilfer/hilfer.rb:
85
+ get gem creation working with Hoe
86
+
87
+ 2008-03-09 21:15 panic
88
+
89
+ * [r3387] trunk, trunk/Rakefile, trunk/bin, trunk/bin/ec,
90
+ trunk/bin/ed, trunk/bin/hilfer, trunk/bin/sd,
91
+ trunk/dev/hilfer.png, trunk/ec, trunk/ed, trunk/hilfer,
92
+ trunk/hilfer-icon.png, trunk/hilfer.png,
93
+ trunk/lib/hilfer/hilfer-icon.png, trunk/lib/hilfer/hilfer.rb,
94
+ trunk/lib/hilfer/tree_viewer.rb, trunk/sd:
95
+ do gem-compatible directory structure
96
+
97
+ 2008-03-09 20:13 panic
98
+
99
+ * [r3386] trunk/Rakefile, trunk/dev, trunk/dev/listen.rb,
100
+ trunk/hilfer.rb, trunk/lib/hilfer/extconf.rb,
101
+ trunk/lib/hilfer/rails_locator.rb, trunk/listen.rb,
102
+ trunk/model.rb, trunk/model/model.rb, trunk/rails_locator.rb,
103
+ trunk/scite_editor.rb, trunk/svn_colours.rb,
104
+ trunk/tree_viewer.rb:
105
+ remove old unused files
106
+
107
+ 2007-06-14 10:55 panic
108
+
109
+ * [r3283] trunk/Rakefile, trunk/extconf.rb, trunk/lib,
110
+ trunk/lib/hilfer, trunk/lib/hilfer/extconf.rb,
111
+ trunk/lib/hilfer/hilfer.rb, trunk/lib/hilfer/rails_locator.rb,
112
+ trunk/lib/hilfer/scite_editor.rb,
113
+ trunk/lib/hilfer/svn_colours.rb,
114
+ trunk/lib/hilfer/tree_viewer.rb, trunk/tree_viewer.rb:
115
+ add missing files
116
+
117
+ 2007-06-04 13:25 panic
118
+
119
+ * [r3270] trunk, trunk/TODO, trunk/ec, trunk/hilfer.rb,
120
+ trunk/hilfer_options.rb, trunk/rails_locator.rb,
121
+ trunk/scite_editor.rb, trunk/sd, trunk/svn_colours.rb:
122
+ merged from no-model
123
+
124
+ 2006-08-12 11:36 panic
125
+
126
+ * [r2384] trunk/model, trunk/model/custom-list.c,
127
+ trunk/model/custom-list.h, trunk/model/hilfer_tree_model.c,
128
+ trunk/model/hilfer_tree_model.h,
129
+ trunk/model/sec-custom-model-code.html:
130
+ add model code
131
+
132
+ 2006-08-12 11:34 root
133
+
134
+ * [r2383] test, trunk/test:
135
+ fix trunk oops
136
+ * [r2382] scite_editor.rb, trunk/scite_editor.rb:
137
+ fix trunk oops
138
+ * [r2381] model.rb, trunk/model.rb:
139
+ fix trunk oops
140
+ * [r2380] listen.rb, trunk/listen.rb:
141
+ fix trunk oops
142
+ * [r2379] hilfer_options.rb, trunk/hilfer_options.rb:
143
+ fix trunk oops
144
+ * [r2378] hilfer.rb, trunk/hilfer.rb:
145
+ fix trunk oops
146
+ * [r2377] hilfer.png, trunk/hilfer.png:
147
+ fix trunk oops
148
+ * [r2376] hilfer-icon.png, trunk/hilfer-icon.png:
149
+ fix trunk oops
150
+ * [r2375] hilfer, trunk/hilfer:
151
+ fix trunk oops
152
+ * [r2374] ed, trunk/ed:
153
+ fix trunk oops
154
+ * [r2373] ec, trunk/ec:
155
+ fix trunk oops
156
+ * [r2372] TODO, trunk/TODO:
157
+ fix trunk oops
158
+
159
+ 2006-08-12 11:22 panic
160
+
161
+ * [r2368] trunk:
162
+ make trunk
6
163
 
data/Manifest.txt ADDED
@@ -0,0 +1,12 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ TODO
6
+ bin/hilfer
7
+ bin/ssc
8
+ lib/hilfer/hilfer-icon.png
9
+ lib/hilfer/rails_locator.rb
10
+ lib/hilfer/scite_editor.rb
11
+ lib/hilfer/svn_colours.rb
12
+ lib/hilfer/tree_viewer.rb
data/README.txt CHANGED
@@ -1,23 +1,101 @@
1
1
  = hilfer
2
2
 
3
- * http://www.semiosix.com/hilfer
3
+ * http://hilfer.rubyforge.org
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- Directory browser with plenty of keyboard shortcuts and integration with scite
8
- rails and subversion
9
-
10
- == FEATURES/PROBLEMS:
11
-
12
- See TODO list
13
-
14
- == SYNOPSIS:
15
-
16
- hilfer [directory]
7
+ Gtk2 directory browser for SciTE with plenty of keyboard shortcuts for directory
8
+ and file navigation. It understands some of the Rails directory structure.
9
+ Subversion file status is highlighted with different colours.
10
+
11
+ Once upon a time there was a directory browser called jaffm (Just a File Manager).
12
+ I liked the idea of an ultra simple file browser, but jaffm went extinct. So
13
+ I wrote hilfer.
14
+
15
+ == FEATURES
16
+
17
+ === Main UI
18
+
19
+ - Incremental keyboard search - just start typing in the window
20
+ - Editable & hideable location bar showing current directory
21
+ - multiple selections usually do The Right Thing.
22
+ - launch Gnome Terminal in a directory
23
+ - close scite on shutdown (command-line option only)
24
+
25
+ === Keyboard Shortcuts
26
+
27
+ - enter - go into directory or open all selected files
28
+ - ctrl-enter opens new window with the selected root(s)
29
+ - backspace - go up to parent directory
30
+ - del on main keyboard or keypad deletes a file
31
+ - ctrl-e and F2 edits the file name
32
+ - ctrl-d sends some debug/info commands to scite
33
+ - ctrl-b sends the current selection to the scite
34
+ - ctrl-c copies current selections as text
35
+ - ctrl-v selects the files in the clipboard
36
+ - ctrl-n opens new window with same root
37
+ - ctrl-y synchronizes with current editor file
38
+ - alt-y toggles automatic synchronization
39
+ - ctrl-r refreshes from filesystem
40
+ - ctrl-t opens a terminal window on the given directorties.
41
+ - alt-l toggles the location bar
42
+ - ctrl-* on keypad means expand the entire tree
43
+ - * on keypad expands subtrees
44
+ - shift-/ on keypad means collapse the entire tree
45
+ - ctrl-left means go to parent
46
+ - ctrl-right means go to last used path, or first child
47
+ - ctrl-up means go to previous sibling with children
48
+ - ctrl-down means go to next sibling with children
49
+ - shift-left means select parent
50
+ - shift-right means select children
51
+ - left means close level(s)
52
+ - right means open level(s)
53
+
54
+ === Rails shortcuts
55
+
56
+ - Shift-Ctrl-V: go to view, or view dir
57
+ - Shift-Ctrl-C: go to controller, or controller dir
58
+ - Shift-Ctrl-M: go to model, or model dir
59
+ - Shift-Ctrl-T: go to test, or test dir
60
+ - Shift-Ctrl-H: go to helpers dir
61
+ - Shift-Ctrl-L: go to layouts dir
62
+ - Shift-Ctrl-I: go to migrations
63
+ - Shift-Ctrl-S: go to stylesheets
64
+ - Shift-Ctrl-F: go to fixtures
65
+
66
+ === Subversion colour highlighting
67
+
68
+ Svn::Wc::STATUS_NONE => '#000', # black
69
+ Svn::Wc::STATUS_NORMAL => '#000', # black
70
+ Svn::Wc::STATUS_ADDED => '#080', # green
71
+ Svn::Wc::STATUS_MISSING => '#f00', # red
72
+ Svn::Wc::STATUS_INCOMPLETE => '#f00', # red
73
+ Svn::Wc::STATUS_DELETED => '#000', # black
74
+ Svn::Wc::STATUS_REPLACED => '#000', # black
75
+ Svn::Wc::STATUS_MODIFIED => '#008', # dark blue
76
+ Svn::Wc::STATUS_MERGED => '#000', # black
77
+ Svn::Wc::STATUS_CONFLICTED => '#f00', # red
78
+ Svn::Wc::STATUS_OBSTRUCTED => '#f00', # red
79
+ Svn::Wc::STATUS_IGNORED => '#880', # brown
80
+ Svn::Wc::STATUS_EXTERNAL => '#000', # black
81
+ Svn::Wc::STATUS_UNVERSIONED => '#808', # purple
82
+
83
+ == PROBLEMS
84
+
85
+ See TODO file
86
+
87
+ == SYNOPSIS
88
+
89
+ Usage: hilfer [options]
90
+ -y, --auto-sync track editor current file changes
91
+ -s, --show-hidden Show hidden files
92
+ -D, -d, -v, --debug Debug output
93
+ -q, --quit-editor close editor on shutdown
94
+ -h, -?, --help Show this help
17
95
 
18
96
  == REQUIREMENTS:
19
97
 
20
- ruby-gtk2
98
+ ruby-gtk2, text-format, subversion-ruby
21
99
 
22
100
  == INSTALL:
23
101
 
@@ -27,7 +105,7 @@ sudo gem install
27
105
 
28
106
  (The MIT License)
29
107
 
30
- Copyright (c) 2008 FIX
108
+ Copyright (c) John Anderson 2008
31
109
 
32
110
  Permission is hereby granted, free of charge, to any person obtaining
33
111
  a copy of this software and associated documentation files (the
data/Rakefile ADDED
@@ -0,0 +1,28 @@
1
+ require 'rubygems'
2
+ require 'rake/clean'
3
+ require 'hoe'
4
+
5
+ Hoe.new('hilfer', '0.9.1') do |s|
6
+ s.author = "John Anderson"
7
+ s.email = "john at semiosix dot com"
8
+ s.extra_deps = [ 'text-format' ]
9
+ end
10
+
11
+ desc "Runs Hilfer"
12
+ task :run do |t|
13
+ ARGV.shift()
14
+ exec "ruby -w -Ilib bin/hilfer -qd #{ARGV.join(' ')}"
15
+ end
16
+
17
+ desc 'Runs irb in this project\'s context'
18
+ task :irb do |t|
19
+ ARGV.shift()
20
+ ENV['RUBYLIB'] += ":#{File.expand_path('.')}/lib"
21
+ exec "irb -Ilib"
22
+ end
23
+
24
+ task :svn2cl do |t|
25
+ `svn2cl -i --break-before-msg -o History.txt`
26
+ end
27
+
28
+ task :docs => :svn2cl
data/TODO ADDED
@@ -0,0 +1,95 @@
1
+ switch focus to editor when opening files
2
+ check for svn ruby requires
3
+ * and / not working properly - wait for HilferModel in c. Might never happen.
4
+ working sets, like eclipse
5
+ option to connect to existing scite
6
+ Sort by directories, then files. Needs Options.
7
+ fix multiple selection editing, ie when several files are selected?
8
+ shift-* to select all descendants
9
+ alt-d to toggle deletion confirmation. Status icon to show warning?
10
+ Ctrl-H to Hide/unhide certain files. Right-click to hide, or Alt-H to hide
11
+
12
+ autosize?
13
+ HilferWindow < Gtk::Window?
14
+ Separate HilferFileItem and HilferDirItem?
15
+ Auto Refresh from filesystem - FileWatcher
16
+ flatten view
17
+ Handle Ctrl-C to save status and options
18
+ move files (drag & drop)
19
+ filters for file types (TreeModelFilter)
20
+ filters for ignorable files
21
+ insert file; file name; output from command
22
+ drag and drop?
23
+ Options dialog
24
+ @root_item to change and be cached
25
+ consolidate model in HilferModel? Not sure if it's worth it.
26
+ use Pathname for HilferItem
27
+
28
+ Maybe
29
+ -----
30
+
31
+ multi column view? Like Mac OS X finder?
32
+ svn integration, as a second "Mode". CVS?
33
+ gnome-vfs integration
34
+ vim/gvim integration
35
+ other terminal program integration eg xfce-terminal
36
+
37
+ Done
38
+ ====
39
+
40
+ 28-jul-2006
41
+ -----------
42
+ save window position
43
+ icons for directories
44
+ improve layout (lines closer)
45
+ left should collapse from within if on a file
46
+ various other movements
47
+ Backspace goes up
48
+ Enter goes down
49
+ do interactive search
50
+ Synchronize
51
+ Do as objects
52
+ typing to find files
53
+ track file switching from editor (ignore if not in current tree).
54
+ only use last_used if it's a child of the current node, unless last_used is a property of HilferItem?
55
+ toggle auto-synchronize
56
+ tree memory - in HilferItem
57
+ don't load entire tree from file system
58
+ auto-scrollbars
59
+
60
+
61
+ 29-jul-2006
62
+ -----------
63
+ Manual Refresh from filesystem
64
+ open in separate window for same editor.
65
+ toggle tracking
66
+ manual refresh
67
+ multiple windows
68
+
69
+ 30-jul-2006
70
+ -----------
71
+ open command window
72
+
73
+ 01-aug-2006
74
+ -----------
75
+
76
+ rename files - Gtk::CellEditable
77
+ delete files
78
+ Show location bar
79
+ alt-l to toggle location bar
80
+
81
+ 11-aug-2006
82
+ -----------
83
+ Auto-start scite, with different pipe names
84
+
85
+ 31-mar-2007
86
+ -----------
87
+ shift-left to select children
88
+ shift-right to select parent's children
89
+ Do all the multiple selection stuff
90
+ Do contextualised rails location jumping
91
+ svn status highlighting
92
+
93
+ 11-mar-2008
94
+ -----------
95
+ package using Hoe
data/bin/hilfer CHANGED
@@ -13,16 +13,22 @@ $options = { :debug => false, :hidden => false, :auto_sync => false, :quit_edito
13
13
  oparser = OptionParser.new
14
14
  oparser.on( '-y', '--auto-sync', 'track editor current file changes') { |o| $options[:host] = true }
15
15
  oparser.on( '-s', '--show-hidden', 'Show hidden files' ) { |o| $options[:user] = true }
16
- oparser.on( '-D', '-d', '-v', '--debug' ) { |o| $options[:debug] = true }
17
- oparser.on( '-q', '--quit-editor', 'close editor on shutdown' ) { |o| puts "o: #{o.inspect}"; $options[:quit_editor] = true }
16
+ oparser.on( '-D', '-d', '-v', '--debug' ) { |o| puts "debug on"; $options[:debug] = true }
17
+ oparser.on( '-q', '--quit-editor', 'close editor on shutdown' ) { |o| $options[:quit_editor] = true }
18
18
 
19
19
  oparser.on( '-h', '-?', '--help' ) do |o|
20
20
  puts oparser.to_s
21
21
  exit( 0 )
22
22
  end
23
23
 
24
- # remove parsed options
25
- ARGV = args = oparser.parse( ARGV )
24
+ # parse options, and make sure Gtk doesn't get them
25
+ args = oparser.parse( ARGV )
26
+
27
+ # output options on debug
28
+ if $options[:debug]
29
+ require 'pp'
30
+ pp $options
31
+ end
26
32
 
27
33
  # this must come after options parsing or it tries to eat the options
28
34
  require 'gtk2'
@@ -217,7 +223,7 @@ class TreeViewerWindow
217
223
  @hc.save
218
224
  # this MUST come before cleanup, otherwise
219
225
  # there will be no pipes to write the command to
220
- @editor.quit
226
+ @editor.quit if $options[:quit_editor]
221
227
  # delete command pipe files
222
228
  @editor.cleanup
223
229
  Gtk.main_quit
@@ -239,8 +245,8 @@ class TreeViewerWindow
239
245
  end
240
246
 
241
247
  def find_icon_path
242
- $LOAD_PATH.grep( /hilfer/ ).each do |path|
243
- png_file = Pathname.new( path ) + 'hilfer-icon.png'
248
+ $LOAD_PATH.each do |path|
249
+ png_file = Pathname.new( path ) + 'hilfer/hilfer-icon.png'
244
250
  return png_file.to_s if png_file.exist?
245
251
  end
246
252
  nil
@@ -252,7 +258,7 @@ end
252
258
  # Main script
253
259
 
254
260
  tvw = TreeViewerWindow.new(
255
- File.expand_path( ARGV[0] || '.' ),
261
+ File.expand_path( args[0] || '.' ),
256
262
  SciteEditor.new
257
263
  )
258
264
 
data/bin/ssc ADDED
@@ -0,0 +1,78 @@
1
+ #! /usr/bin/ruby
2
+
3
+ require 'optparse'
4
+ require 'text/format'
5
+
6
+ # display help and commands
7
+ oparser = OptionParser.new
8
+ oparser.banner = "Usage: ssc [-h] | cmd[ cmd][...]"
9
+ oparser.on( '-h', '-?', '--help' ) do |o|
10
+ puts oparser.to_s
11
+ puts
12
+ puts "Send one or several commands to the current scite"
13
+ puts
14
+ puts "Commands are (http://scintilla.sourceforge.net/SciTEDirector.html):"
15
+ puts
16
+ st = <<EOF
17
+ askfilename:|Return the name of the file being edited.
18
+ askproperty:<key>|Return the value of a property.
19
+ close:|Close the current file.
20
+ closing:|Director is closing - SciTE closes if it was started by the director.
21
+ currentmacro:<string>|Set the current macro to name.
22
+ cwd:|Change the working directory.
23
+ enumproperties:dyn|local|user|base|embed|Enumerate all the properties in the argument set.
24
+ exportashtml:<path>|Save the document in HTML format as the indicated file.
25
+ exportasrtf:<path>|Save the document in RTF format as the indicated file.
26
+ exportaspdf:<path>|Save the document in PDF format as the indicated file.
27
+ exportaslatex:<path>|Save the document in LaTeX format as the indicated file.
28
+ exportasxml:<path>|Save the document in XML format as the indicated file.
29
+ extender:<command>|Call the extension interface with the given command.
30
+ find:<string>|Search for a string, select and show it.
31
+ focus:<timeStamp>|On GTK+ bring this SciTE window to the front. The timeStamp is from the window manager and ensures that windows are only activated because of a user command. Has no effect on Windows as applications on Windows can only donate focus, not take focus.
32
+ goto:<line>[,<col>]|Move caret to a particular line and make it visible. If there is a column number then select the word at that column number or move the caret there if no word is present.
33
+ identity:<hwndDirector>|Sets the director window handle to which SciTE sends messages. The argument is in decimal.
34
+ insert:<value>|Display the value in the editor pane replacing the selection.
35
+ loadsession:<path>|Load a session as given by the indicated file.
36
+ macrocommand:<command>|Execute a macro command. See the SciTE source code for the syntax of the command argument.
37
+ macroenable:<enable>|If enable, display menu commands in SciTE for recording and playing macros.
38
+ macrolist:<list>|Display a list for the user to choose from.
39
+ menucommand:<cmd>|Execute a menu command based on numeric ID.
40
+ open:<path>|Open the indicated file.
41
+ output:<value>|Display the value in the output pane replacing the selection.
42
+ property:<key>=<value>|Set a property to a value.
43
+ quit:|Shut down SciTE.
44
+ reloadproperties:|Reload properties from files.
45
+ replaceall:<srch>\\000<rep>|Replace all instances of he search string in the document with the replace string.
46
+ saveas:<path>|Save the document as the indicated file.
47
+ savesession:<path>|Save a session as given by the indicated file.
48
+ EOF
49
+ cmds = st.split(/\n/)
50
+ re = /(.*?)\|(.*)/
51
+ tf = Text::Format.new( :format_style => :fill, :left_margin => 28, :columns => 90 )
52
+ cmds.each do |ln|
53
+ cmd, desc = re.match( ln ).to_a[1..-1]
54
+ desc = tf.format(desc)
55
+ puts( "%-28s%-52s" % [ cmd, desc.strip ] )
56
+ end
57
+ exit( 0 )
58
+ end
59
+
60
+ # parse options
61
+ args = oparser.parse( ARGV )
62
+
63
+ # which is the pipe file
64
+ pipe_name_file_name = "/tmp/#{ENV['USER']}.hilfer.scite"
65
+ if !File.exists?( pipe_name_file_name )
66
+ puts "#{pipe_name_file_name} does not exist"
67
+ exit(1)
68
+ end
69
+
70
+ # open pipe and write commands
71
+ pipe_name = IO.read( pipe_name_file_name ).chomp
72
+ if File.exists? pipe_name
73
+ File.open( pipe_name, 'w+' ) do |file|
74
+ for cmd in ARGV
75
+ file.puts cmd
76
+ end
77
+ end
78
+ end
File without changes
@@ -1,6 +1,5 @@
1
1
  # handle director interface to scite
2
2
  class SciteEditor
3
-
4
3
  # options can contain :debug
5
4
  # view is a GtkTreeView
6
5
  def initialize( options = {} )
@@ -19,6 +18,10 @@ class SciteEditor
19
18
  @options = options
20
19
  end
21
20
 
21
+ def launched?
22
+ File.exists?( @director_pipe_name )
23
+ end
24
+
22
25
  def cleanup
23
26
  FileUtils.rm @scite_pipe_name if File.exist? @scite_pipe_name
24
27
  FileUtils.rm @director_pipe_name if File.exist? @director_pipe_name
@@ -50,9 +53,9 @@ class SciteEditor
50
53
  send 'askfilename'
51
54
  end
52
55
 
53
- # shut down editor
56
+ # shut down editor, if it's open
54
57
  def quit
55
- send 'quit'
58
+ send 'quit' if launched?
56
59
  end
57
60
 
58
61
  # insert text to editor, at current caret, or overwriting the current selection
@@ -101,7 +104,7 @@ protected
101
104
  end
102
105
 
103
106
  # scite already open, so don't launch another instance
104
- return if File.exists?( @scite_pipe_name )
107
+ return if File.exists? @scite_pipe_name
105
108
 
106
109
  cmd = <<EOF
107
110
  /usr/bin/scite
@@ -111,11 +114,16 @@ EOF
111
114
  oneline = cmd.gsub( "\n", " ")
112
115
  child_pid = fork
113
116
  if child_pid.nil?
117
+ # start the editor and wait for it to end
114
118
  system( oneline )
115
119
 
116
120
  # scite ended, so delete the pipes
117
- File.unlink @director_pipe_name if File.exist? @director_pipe_name
118
- File.unlink @scite_pipe_name if File.exist? @scite_pipe_name
121
+ begin
122
+ File.unlink @director_pipe_name if File.exist? @director_pipe_name
123
+ File.unlink @scite_pipe_name if File.exist? @scite_pipe_name
124
+ rescue Exception => e
125
+ puts e.message
126
+ end
119
127
 
120
128
  # unfork, don't trigger a SystemException
121
129
  exit! true
@@ -6,20 +6,20 @@ require 'svn/client'
6
6
  module SvnColours
7
7
  def status_colours
8
8
  @status_colours ||= {
9
- Svn::Wc::STATUS_NONE => '#000',
10
- Svn::Wc::STATUS_NORMAL => '#000',
9
+ Svn::Wc::STATUS_NONE => '#000', # black
10
+ Svn::Wc::STATUS_NORMAL => '#000', # black
11
11
  Svn::Wc::STATUS_ADDED => '#080', # green
12
- Svn::Wc::STATUS_MISSING => '#f00',
13
- Svn::Wc::STATUS_INCOMPLETE => '#f00',
14
- Svn::Wc::STATUS_DELETED => '#000',
15
- Svn::Wc::STATUS_REPLACED => '#000',
16
- Svn::Wc::STATUS_MODIFIED => '#008',
17
- Svn::Wc::STATUS_MERGED => '#000',
18
- Svn::Wc::STATUS_CONFLICTED => '#f00',
19
- Svn::Wc::STATUS_OBSTRUCTED => '#f00',
20
- Svn::Wc::STATUS_IGNORED => '#880',
21
- Svn::Wc::STATUS_EXTERNAL => '#000',
22
- Svn::Wc::STATUS_UNVERSIONED => '#808',
12
+ Svn::Wc::STATUS_MISSING => '#f00', # red
13
+ Svn::Wc::STATUS_INCOMPLETE => '#f00', # red
14
+ Svn::Wc::STATUS_DELETED => '#000', # black
15
+ Svn::Wc::STATUS_REPLACED => '#000', # black
16
+ Svn::Wc::STATUS_MODIFIED => '#008', # dark blue
17
+ Svn::Wc::STATUS_MERGED => '#000', # black
18
+ Svn::Wc::STATUS_CONFLICTED => '#f00', # red
19
+ Svn::Wc::STATUS_OBSTRUCTED => '#f00', # red
20
+ Svn::Wc::STATUS_IGNORED => '#880', # brown
21
+ Svn::Wc::STATUS_EXTERNAL => '#000', # black
22
+ Svn::Wc::STATUS_UNVERSIONED => '#808', # purple
23
23
  }
24
24
  end
25
25
 
@@ -293,7 +293,7 @@ class TreeViewer
293
293
  case
294
294
  # enter - go into directory
295
295
  # or open all selected files
296
- when event.hardware_keycode == 36 && event.state.empty?
296
+ when event.hardware_keycode == 36 && !event.state.control_mask?
297
297
  items = []
298
298
 
299
299
  # fetch all selected items
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hilfer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Anderson
@@ -9,9 +9,18 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-03-31 00:00:00 +02:00
12
+ date: 2008-04-01 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: text-format
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ version:
15
24
  - !ruby/object:Gem::Dependency
16
25
  name: hoe
17
26
  version_requirement:
@@ -19,33 +28,34 @@ dependencies:
19
28
  requirements:
20
29
  - - ">="
21
30
  - !ruby/object:Gem::Version
22
- version: 1.5.0
31
+ version: 1.5.1
23
32
  version:
24
- description: Directory browser with plenty of keyboard shortcuts and integration with scite rails and subversion
33
+ description: Gtk2 directory browser for SciTE with plenty of keyboard shortcuts for directory and file navigation. It understands some of the Rails directory structure. Subversion file status is highlighted with different colours. Once upon a time there was a directory browser called jaffm (Just a File Manager). I liked the idea of an ultra simple file browser, but jaffm went extinct. So I wrote hilfer.
25
34
  email: john at semiosix dot com
26
35
  executables:
27
- - ec
28
- - sd
29
36
  - hilfer
30
- - hilfer-icon.png
37
+ - ssc
31
38
  extensions: []
32
39
 
33
40
  extra_rdoc_files:
34
- - README.txt
35
41
  - History.txt
42
+ - Manifest.txt
43
+ - README.txt
36
44
  files:
37
- - bin/ec
38
- - bin/sd
45
+ - History.txt
46
+ - Manifest.txt
47
+ - README.txt
48
+ - Rakefile
49
+ - TODO
39
50
  - bin/hilfer
40
- - bin/hilfer-icon.png
41
- - lib/hilfer/tree_viewer.rb
42
- - lib/hilfer/scite_editor.rb
51
+ - bin/ssc
52
+ - lib/hilfer/hilfer-icon.png
43
53
  - lib/hilfer/rails_locator.rb
54
+ - lib/hilfer/scite_editor.rb
44
55
  - lib/hilfer/svn_colours.rb
45
- - README.txt
46
- - History.txt
56
+ - lib/hilfer/tree_viewer.rb
47
57
  has_rdoc: true
48
- homepage: http://www.semiosix.com/hilfer
58
+ homepage: http://hilfer.rubyforge.org
49
59
  post_install_message:
50
60
  rdoc_options:
51
61
  - --main
@@ -67,9 +77,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
77
  requirements: []
68
78
 
69
79
  rubyforge_project: hilfer
70
- rubygems_version: 1.0.1
80
+ rubygems_version: 1.1.0
71
81
  signing_key:
72
82
  specification_version: 2
73
- summary: Directory browser with plenty of keyboard shortcuts and integration with scite rails and subversion
83
+ summary: Gtk2 directory browser for SciTE with plenty of keyboard shortcuts for directory and file navigation
74
84
  test_files: []
75
85
 
data/bin/ec DELETED
@@ -1,9 +0,0 @@
1
- #! /bin/bash
2
- pipe=` cat /tmp/$USER.hilfer.scite`
3
- if [ x$1 == x ]; then
4
- wd=`pwd`
5
- else
6
- wd=$1
7
- fi
8
-
9
- test -e $pipe && echo cwd:$wd >$pipe
data/bin/sd DELETED
@@ -1,17 +0,0 @@
1
- #! /bin/bash
2
- pipe=`cat /tmp/$USER.hilfer.scite`
3
- director=/tmp/$USER.scite.director
4
- wd=`pwd`
5
- if [ -e $pipe ]; then
6
- for name in $@; do
7
- echo open:$wd/$name >$pipe;
8
- done
9
- else
10
- test -e $pipe && /bin/rm $pipe
11
- test -e $director && /bin/rm $director
12
- /usr/bin/mkfifo $director
13
- /usr/bin/scite \
14
- -ipc.director.name=$director \
15
- -ipc.scite.name=$pipe \
16
- $@ &
17
- fi