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

Commit

Permalink
gedit as editor\
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyarcher committed Sep 11, 2011
1 parent 7d9918c commit 5cec655
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
21 changes: 21 additions & 0 deletions Library/Homebrew/brew.h.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ def check_for_blacklisted_formula names
end
end


def editmake url
path = Pathname.new url

/(.*?)[-_.]?#{path.version}/.match path.basename

unless $1.to_s.empty?
name = $1
else
print "Formula name [#{path.stem}]: "
gots = $stdin.gets.chomp
if gots.empty?
name = path.stem
else
name = gots
end
end

"#{FORMULA_REPOSITORY}#{name.downcase}.rb"
end

def __make url, name
require 'formula'
require 'digest'
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def self.factory name
end

def self.path name
"#{FORMULA_REPOSITORY}/#{name.downcase}.rb"
"#{FORMULA_REPOSITORY}#{name.downcase}.rb"
end

def deps
Expand Down
3 changes: 3 additions & 0 deletions Library/Homebrew/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ def exec_editor *args
if system "#{SystemCommand.which_s} mate"
# TextMate
editor='mate'
elsif system "#{SystemCommand.which_s} gedit"
# gedit
editor='gedit'
elsif system "#{SystemCommand.which_s} edit"
# BBEdit / TextWrangler
editor='edit'
Expand Down
2 changes: 1 addition & 1 deletion bin/brew
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ begin
elsif ARGV.named.empty?
raise UsageError
else
exec_editor(*ARGV.named.collect {|name| make name})
exec_editor(*ARGV.named.collect {|name| editmake name})
end

when 'diy', 'configure'
Expand Down

0 comments on commit 5cec655

Please sign in to comment.