Sha256: 9fe682af8af4815da7fca953c501ee742db37dabe70b46bee15c36553ce44139

Contents?: true

Size: 391 Bytes

Versions: 333

Compression:

Stored size: 391 Bytes

Contents

require_relative "line_editor/basic"
require_relative "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

Version data entries

333 entries across 333 versions & 8 rubygems

Version Path
bundler-2.1.3 lib/bundler/vendor/thor/lib/thor/line_editor.rb
rubygems-update-3.1.2 bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb
bundler-2.1.2 lib/bundler/vendor/thor/lib/thor/line_editor.rb
bundler-2.1.1 lib/bundler/vendor/thor/lib/thor/line_editor.rb
rubygems-update-3.1.1 bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb
rubygems-update-3.1.0 bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb
bundler-2.1.0 lib/bundler/vendor/thor/lib/thor/line_editor.rb
rubygems-update-3.1.0.pre3 bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb
bundler-2.1.0.pre.3 lib/bundler/vendor/thor/lib/thor/line_editor.rb
rubygems-update-3.1.0.pre2 bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb
rubygems-update-3.1.0.pre1 bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb
bundler-2.1.0.pre.2 lib/bundler/vendor/thor/lib/thor/line_editor.rb
bundler-2.1.0.pre.1 lib/bundler/vendor/thor/lib/thor/line_editor.rb