summaryrefslogtreecommitdiff
path: root/lib/pry/pry_class.rb
diff options
context:
space:
mode:
authorKyrylo Silin <silin@kyrylo.org>2018-11-02 00:16:35 +0800
committerKyrylo Silin <silin@kyrylo.org>2018-11-02 01:52:09 +0800
commit187c199e7773e1e5227a13ee69433b382f6c0b5f (patch)
tree2d220ef85847fe6da27cdf05e77a071484ed528d /lib/pry/pry_class.rb
parent4ff2eb7207d9b583a904a186ca22b93c97ffee48 (diff)
downloadpry-187c199e7773e1e5227a13ee69433b382f6c0b5f.tar.gz
Deprecate Pry::Platform and introduce Pry::Helpers::Platform
`Pry::Platform` really looks like a helper and therefore should be defined as one. Invoking `Pry::Platform` emits a warning now. Users are encouraged to use `Pry::Helpers::Platform`.
Diffstat (limited to 'lib/pry/pry_class.rb')
-rw-r--r--lib/pry/pry_class.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/pry/pry_class.rb b/lib/pry/pry_class.rb
index 356a2127..82235422 100644
--- a/lib/pry/pry_class.rb
+++ b/lib/pry/pry_class.rb
@@ -157,7 +157,7 @@ you can add "Pry.config.windows_console_warning = false" to your pryrc.
load_requires if Pry.config.should_load_requires
load_history if Pry.config.history.should_load
load_traps if Pry.config.should_trap_interrupts
- load_win32console if Pry::Helpers::BaseHelpers.windows? && !Pry::Helpers::BaseHelpers.windows_ansi?
+ load_win32console if Helpers::Platform.windows? && !Helpers::Platform.windows_ansi?
end
# Start a Pry REPL.
@@ -296,13 +296,10 @@ you can add "Pry.config.windows_console_warning = false" to your pryrc.
def self.default_editor_for_platform
return ENV['VISUAL'] if ENV['VISUAL'] and not ENV['VISUAL'].empty?
return ENV['EDITOR'] if ENV['EDITOR'] and not ENV['EDITOR'].empty?
+ return 'notepad' if Helpers::Platform.windows?
- if Helpers::BaseHelpers.windows?
- 'notepad'
- else
- %w(editor nano vi).detect do |editor|
- system("which #{editor} > /dev/null 2>&1")
- end
+ %w(editor nano vi).detect do |editor|
+ system("which #{editor} > /dev/null 2>&1")
end
end