Module: MJ::Tools
- Defined in:
- lib/mj/tools/ssh.rb,
lib/mj/tools/editor.rb,
lib/mj/tools/subprocess.rb
Defined Under Namespace
Modules: SubProcess Classes: SSH, TmpFileEditor
Constant Summary collapse
- @@editor =
nil
Class Method Summary collapse
-
.editor ⇒ Object
Look for a suitable editor in the users environment.
Class Method Details
.editor ⇒ Object
Look for a suitable editor in the users environment.
We check
-
$VISUAL (if $DISPLAY is set)
-
$GUIEDITOR (if $DISPLAY is set)
-
$EDITOR
-
Giving up
The result is cached.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/mj/tools/editor.rb', line 18 def Tools.editor() return @@editor if @@editor logger.debug( 'Looking for a editor.' ) if ENV.include?( 'DISPLAY' ) logger.debug( 'Checking $VISUAL' ) return @@editor = ENV['VISUAL'] if ENV.include?( 'VISUAL' ) logger.debug( 'Checking $GUIEDITOR' ) return @@editor = ENV['GUIEDITOR'] if ENV.include?( 'GUIEDITOR' ) end logger.debug( 'Checking $EDITOR' ) return @@editor = ENV['EDITOR'] if ENV.include?( 'EDITOR' ) end |