Class: Thor::LineEditor::Readline

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/rails_ai_context/install/install_generator.rb

Class Method Summary collapse

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


17
18
19
20
21
22
23
24
25
26
# File 'lib/generators/rails_ai_context/install/install_generator.rb', line 17

def self.available?
  return false unless $stdin.tty? && $stdout.tty?

  begin
    require "readline"
  rescue LoadError
  end

  Object.const_defined?(:Readline)
end