Sha256: dd93860fd063658ee5ce665f462b9d1ff7eb88db7a12d3ec21d58199846ca6b6

Contents?: true

Size: 541 Bytes

Versions: 150

Compression:

Stored size: 541 Bytes

Contents

class Bundler::Thor
  module LineEditor
    class Basic
      attr_reader :prompt, :options

      def self.available?
        true
      end

      def initialize(prompt, options)
        @prompt = prompt
        @options = options
      end

      def readline
        $stdout.print(prompt)
        get_input
      end

    private

      def get_input
        if echo?
          $stdin.gets
        else
          $stdin.noecho(&:gets)
        end
      end

      def echo?
        options.fetch(:echo, true)
      end
    end
  end
end

Version data entries

150 entries across 122 versions & 7 rubygems

Version Path
rb2exe-0.3.1 bin/traveling-ruby-2.2.2/osx/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
rb2exe-0.3.1 bin/traveling-ruby-2.2.2/win/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
rb2exe-0.3.1 bin/traveling-ruby-2.2.2/l32/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
rb2exe-0.3.1 bin/traveling-ruby-2.2.2/l64/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
rubygems-update-2.6.14 bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
rubygems-update-2.6.13 bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
bundler-1.15.3 lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
bundler-1.15.2 lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
bundler-1.15.1 lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
bundler-1.15.0 lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
bundler-1.15.0.pre.4 lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
bundler-1.15.0.pre.3 lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
rubygems-update-2.6.12 bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
rb2exe-0.3.0 bin/traveling-ruby-2.2.2/osx/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
rb2exe-0.3.0 bin/traveling-ruby-2.2.2/win/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
rb2exe-0.3.0 bin/traveling-ruby-2.2.2/l64/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
rb2exe-0.3.0 bin/traveling-ruby-2.2.2/l32/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
bundler-1.15.0.pre.2 lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
rb2exe-0.2.5 bin/traveling-ruby-2.2.2/osx/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb