Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

Commit

Permalink
Allow the Editor to be a lambda or a Proc.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed May 26, 2009
1 parent 7bee882 commit ddb94f2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/sketches/sketch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ def synchronize(&block)
# Spawns the Sketches.editor with the path of the sketch.
#
def edit
system(Config.editor.to_s,@path)
if Config.editor.kind_of?(Proc)
cmd = Config.editor.call(@path)
else
cmd = "#{Config.editor} #{@path}"
end

system(cmd)
end

#
Expand Down

0 comments on commit ddb94f2

Please sign in to comment.