Repository: JEG2/highline (Ruby)

Issue:
`ask()` causes `Readline`-related error on Ruby 3.3
On Ruby 3.3, `ask()` causes the following error:

```
/path/to/gems/ruby-3.3.1/gems/highline-3.0.1/lib/highline/terminal.rb:115:in `readline_read': uninitialized constant HighLine::Terminal::Readline (NameError)

        Readline.completion_proc = lambda do |str|
        ^^^^^^^^
Did you mean?  Reline
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline/terminal.rb:100:in `get_line_with_readline'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline/terminal.rb:87:in `get_line'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline.rb:541:in `get_line'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline.rb:525:in `get_response_line_mode'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline/question.rb:534:in `get_response'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline/question.rb:546:in `get_response_or_default'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline/question_asker.rb:31:in `ask_once'
	from /path/to/ruby-3.3.1/gems/highline-3.0.1/lib/highline.rb:222:in `ask'
```

Renaming `Readline` calls to `Reline` seems to fix the issue, but I'm not familiar with the codebase.


Discussion: Thanks for reporting it. I'll take a look at it as soon as possible. I'll keep you informed.
At [Ruby 3.3.0 release note](https://www.ruby-lang.org/en/news/2023/12/25/ruby-3-3-0-released/) we have:
```
Stdlib compatibility issues
ext/readline is retired

    We have reline that is pure Ruby implementation compatible with ext/readline API.
    We rely on reline in the future. If you need to use ext/readline,
      you can install ext/readline via rubygems.org with gem install readline-ext.
    We no longer need to install libraries like libreadline or libedit.
```
Hi @64kramsystem 

Fixed and released (see: https://rubygems.org/gems/highline/versions/3.1.0)

Could you confirm it now works ok for you (at version 3.1.0) ?

Thank you for reporting it.





Fix (patch):
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ae4eaf7..e149742 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -36,7 +36,7 @@ jobs:
             ruby-version: '3.3'
     runs-on: ${{ matrix.os }}
     steps:
-    - uses: actions/checkout@v3
+    - uses: actions/checkout@v4
     - name: Set up Ruby ${{ matrix.ruby-version }}
       uses: ruby/setup-ruby@v1
       with:
diff --git a/Changelog.md b/Changelog.md
index 1361e1d..dedf7e5 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -2,6 +2,10 @@
 
 Below is a complete listing of changes for each revision of HighLine.
 
+### 3.1.0 / 2024-07-15
+* PR #272 / I #271 - Readline is now completed deprecated over Reline (@abinoam, issue by @64kramsystem)
+* PR #269 - Provide a 'Changelog' link on rubygems.org/gems/highline (@mark-young-atg)
+
 ### 3.0.1 / 2024-01-20
 * PR #268 - Remove unused abbrev dependency (@zvkemp)
 
diff --git a/highline.gemspec b/highline.gemspec
index 69bad54..fa77e0e 100644
--- a/highline.gemspec
+++ b/highline.gemspec
@@ -33,7 +33,8 @@ DESCRIPTION
   spec.add_development_dependency "rake"
   spec.add_development_dependency "minitest"
   spec.add_development_dependency "dry-types"
-  spec.add_development_dependency "reline"
+
+  spec.add_runtime_dependency "reline"
 
   spec.metadata["changelog_uri"] = spec.homepage + "/blob/master/Changelog.md"
 end
diff --git a/lib/highline/terminal.rb b/lib/highline/terminal.rb
index b98a7a6..7e0078f 100644
--- a/lib/highline/terminal.rb
+++ b/lib/highline/terminal.rb
@@ -112,7 +112,7 @@ def get_line_with_readline(question, highline)
     def readline_read(question, highline)
       # prep auto-completion
       unless question.selection.empty?
-        Readline.completion_proc = lambda do |str|
+        Reline.completion_proc = lambda do |str|
           question.selection.grep(/\A#{Regexp.escape(str)}/)
         end
       end
@@ -124,7 +124,7 @@ def readline_read(question, highline)
 
       raw_answer  = run_preserving_stty do
         prompt = highline.render_and_ident_statement(question)
-        Readline.readline(prompt, true)
+        Reline.readline(prompt, true)
       end
 
       $VERBOSE = old_verbose
diff --git a/lib/highline/version.rb b/lib/highline/version.rb
index 86527df..8524f57 100644
--- a/lib/highline/version.rb
+++ b/lib/highline/version.rb
@@ -2,5 +2,5 @@
 
 class HighLine
   # The version of the installed library.
-  VERSION = "3.0.1".freeze
+  VERSION = "3.1.0".freeze
 end