added Pry.editor option for use by the edit-method command

This commit is contained in:
John Mair 2011-04-26 03:21:42 +12:00
parent 4fc757ece1
commit 477a25ae21
1 changed files with 6 additions and 0 deletions

View File

@ -98,6 +98,11 @@ class Pry
# Set to true if the pry-doc extension is loaded. # Set to true if the pry-doc extension is loaded.
# @return [Boolean] # @return [Boolean]
attr_accessor :has_pry_doc 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 end
# Load the rc files given in the `Pry::RC_FILES` array. # Load the rc files given in the `Pry::RC_FILES` array.
@ -216,6 +221,7 @@ class Pry
@should_load_rc = true @should_load_rc = true
@rc_loaded = false @rc_loaded = false
@cli = false @cli = false
@editor = ENV['EDITOR'] ? ENV['EDITOR'] : "nano"
end end
self.reset_defaults self.reset_defaults