aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/vendor/thor/lib/thor/line_editor.rb
blob: ce81a17484d054288d46d8803df4633e1df3fdc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require "bundler/vendor/thor/lib/thor/line_editor/basic"
require "bundler/vendor/thor/lib/thor/line_editor/readline"

class Bundler::Thor
  module LineEditor
    def self.readline(prompt, options = {})
      best_available.new(prompt, options).readline
    end

    def self.best_available
      [
        Bundler::Thor::LineEditor::Readline,
        Bundler::Thor::LineEditor::Basic
      ].detect(&:available?)
    end
  end
end