Merge pull request #25 from jaylevitt/master
Allow QWANDRY_EDITOR variable
This commit is contained in:
commit
22d35a2576
2
Rakefile
2
Rakefile
@ -1,6 +1,6 @@
|
|||||||
require 'rake'
|
require 'rake'
|
||||||
require 'rake/testtask'
|
require 'rake/testtask'
|
||||||
require 'rake/rdoctask'
|
require 'rdoc/task'
|
||||||
|
|
||||||
begin
|
begin
|
||||||
require 'jeweler'
|
require 'jeweler'
|
||||||
|
@ -25,10 +25,10 @@ module Qwandry
|
|||||||
# Launches a Package or path represented by a String. Unless `editor` will
|
# Launches a Package or path represented by a String. Unless `editor` will
|
||||||
# check against the environment by default.
|
# check against the environment by default.
|
||||||
def launch(package, editor=nil)
|
def launch(package, editor=nil)
|
||||||
editor ||= @editor || ENV['VISUAL'] || ENV['EDITOR']
|
editor ||= @editor || ENV['QWANDRY_EDITOR'] || ENV['VISUAL'] || ENV['EDITOR']
|
||||||
|
|
||||||
if (!editor) || (editor =~ /^\s*$/) # if the editor is not set, or is blank, exit with a message:
|
if (!editor) || (editor =~ /^\s*$/) # if the editor is not set, or is blank, exit with a message:
|
||||||
puts "Please either set EDITOR or pass in an editor to use"
|
puts "Please set QWANDRY_EDITOR, VISUAL or EDITOR, or pass in an editor to use"
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user