mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Use File.basename not regex, thanks Mon_Ouie
This commit is contained in:
parent
e306ff5584
commit
13c1a615a3
1 changed files with 6 additions and 1 deletions
|
@ -154,8 +154,13 @@ class Pry
|
|||
# This is useful for deciding which flags we pass to the editor as
|
||||
# we can just use the program's name and ignore any absolute paths.
|
||||
#
|
||||
# @example
|
||||
# Pry.config.editor="/home/conrad/bin/textmate -w"
|
||||
# editor_name
|
||||
# # => textmate
|
||||
#
|
||||
def editor_name
|
||||
Pry.config.editor.split(%r{[\\/]}).last.split(" ").first
|
||||
File.basename(Pry.config.editor).split(" ").first
|
||||
end
|
||||
|
||||
# Remove any common leading whitespace from every line in `text`.
|
||||
|
|
Loading…
Reference in a new issue