From 477a25ae210f24e72b29da8215257b7ae6982b0f Mon Sep 17 00:00:00 2001 From: John Mair Date: Tue, 26 Apr 2011 03:21:42 +1200 Subject: [PATCH] added Pry.editor option for use by the edit-method command --- lib/pry/pry_class.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/pry/pry_class.rb b/lib/pry/pry_class.rb index 052739d3..31a5997b 100644 --- a/lib/pry/pry_class.rb +++ b/lib/pry/pry_class.rb @@ -98,6 +98,11 @@ class Pry # Set to true if the pry-doc extension is loaded. # @return [Boolean] attr_accessor :has_pry_doc + + # The default editor to use. Defaults to $EDITOR or nano if + # $EDITOR is not defined. + # @return [String] + attr_accessor :editor end # Load the rc files given in the `Pry::RC_FILES` array. @@ -216,6 +221,7 @@ class Pry @should_load_rc = true @rc_loaded = false @cli = false + @editor = ENV['EDITOR'] ? ENV['EDITOR'] : "nano" end self.reset_defaults