irb-autosuggestions 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8e1ec7a3ce26018f3370e751867a4c0b949978ed1642609f737686c56a7c52ec
4
+ data.tar.gz: c0cdc0ec34d660207c7541f0f2b36eea14bbc316f1e8d5eb6f6127c029a862f2
5
+ SHA512:
6
+ metadata.gz: e41c47949a5d0016e8417aa49e29f86fb8406ba634e59b7972dd287396d523fb9d8094b318ba0d6a0941b45c11618aefdc81234298edbb8a8e5180002f5d3e82
7
+ data.tar.gz: 587fab5c5988e9ba7387f691d8c8a48adabb081d5be751f09b13f847a581bafed98d8f988d0e7827ce2f297c6d1c6247f7ade5b3b6470b780c2b6d7a6a9a2083
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,24 @@
1
+ plugins:
2
+ - rubocop-sorted_methods_by_call
3
+ - rubocop-rspec
4
+ - rubocop-rake
5
+
6
+ AllCops:
7
+ NewCops: enable
8
+ TargetRubyVersion: 3.0
9
+
10
+ Style/DoubleNegation:
11
+ Enabled: false
12
+
13
+ Style/RedundantFetchBlock:
14
+ Enabled: false
15
+
16
+ Naming/FileName:
17
+ Exclude:
18
+ - lib/irb-autosuggestions.rb
19
+
20
+ Metrics/ModuleLength:
21
+ Max: 110
22
+
23
+ Gemspec/DevelopmentDependencies:
24
+ EnforcedStyle: gemspec
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.0.7
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in irb-autosuggestions.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,92 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ irb-autosuggestions (0.1.0)
5
+ reline
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.3)
11
+ diff-lcs (1.6.2)
12
+ docscribe (1.3.3)
13
+ parser (>= 3.3)
14
+ prism (~> 1.8)
15
+ io-console (0.8.2)
16
+ json (2.19.5)
17
+ language_server-protocol (3.17.0.5)
18
+ lint_roller (1.1.0)
19
+ logger (1.7.0)
20
+ parallel (1.28.0)
21
+ parser (3.3.11.1)
22
+ ast (~> 2.4.1)
23
+ racc
24
+ prism (1.9.0)
25
+ racc (1.8.1)
26
+ rainbow (3.1.1)
27
+ rake (13.4.2)
28
+ rbs (3.6.1)
29
+ logger
30
+ regexp_parser (2.12.0)
31
+ reline (0.6.3)
32
+ io-console (~> 0.5)
33
+ rspec (3.13.2)
34
+ rspec-core (~> 3.13.0)
35
+ rspec-expectations (~> 3.13.0)
36
+ rspec-mocks (~> 3.13.0)
37
+ rspec-core (3.13.6)
38
+ rspec-support (~> 3.13.0)
39
+ rspec-expectations (3.13.5)
40
+ diff-lcs (>= 1.2.0, < 2.0)
41
+ rspec-support (~> 3.13.0)
42
+ rspec-mocks (3.13.8)
43
+ diff-lcs (>= 1.2.0, < 2.0)
44
+ rspec-support (~> 3.13.0)
45
+ rspec-support (3.13.7)
46
+ rubocop (1.86.2)
47
+ json (~> 2.3)
48
+ language_server-protocol (~> 3.17.0.2)
49
+ lint_roller (~> 1.1.0)
50
+ parallel (>= 1.10)
51
+ parser (>= 3.3.0.2)
52
+ rainbow (>= 2.2.2, < 4.0)
53
+ regexp_parser (>= 2.9.3, < 3.0)
54
+ rubocop-ast (>= 1.49.0, < 2.0)
55
+ ruby-progressbar (~> 1.7)
56
+ unicode-display_width (>= 2.4.0, < 4.0)
57
+ rubocop-ast (1.49.1)
58
+ parser (>= 3.3.7.2)
59
+ prism (~> 1.7)
60
+ rubocop-rake (0.7.1)
61
+ lint_roller (~> 1.1)
62
+ rubocop (>= 1.72.1)
63
+ rubocop-rspec (3.9.0)
64
+ lint_roller (~> 1.1)
65
+ rubocop (~> 1.81)
66
+ rubocop-sorted_methods_by_call (1.2.2)
67
+ lint_roller
68
+ rubocop (>= 1.72.0)
69
+ ruby-progressbar (1.13.0)
70
+ unicode-display_width (3.2.0)
71
+ unicode-emoji (~> 4.1)
72
+ unicode-emoji (4.2.0)
73
+ yard (0.9.43)
74
+
75
+ PLATFORMS
76
+ arm64-darwin-25
77
+ x86_64-linux
78
+
79
+ DEPENDENCIES
80
+ docscribe
81
+ irb-autosuggestions!
82
+ rake
83
+ rbs
84
+ rspec (~> 3.0)
85
+ rubocop
86
+ rubocop-rake
87
+ rubocop-rspec
88
+ rubocop-sorted_methods_by_call
89
+ yard (>= 0.9.38)
90
+
91
+ BUNDLED WITH
92
+ 2.5.23
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 unurgunite
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # Irb::Autosuggestions
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/irb-autosuggestions.svg)](https://rubygems.org/gems/irb-autosuggestions)
4
+ [![CI](https://github.com/unurgunite/irb-autosuggestions/actions/workflows/ci.yml/badge.svg)](https://github.com/unurgunite/irb-autosuggestions/actions)
5
+
6
+ ![Irb::Autosuggestions](readme.png)
7
+
8
+ No need to explain. Fish-like autosuggestions for IRB — ghost text from history as you type.
9
+
10
+ ## Contents
11
+
12
+ * [Irb::Autosuggestions](#irbautosuggestions)
13
+ * [Contents](#contents)
14
+ * [Installation](#installation)
15
+ * [Usage](#usage)
16
+ * [How it works](#how-it-works)
17
+ * [Development](#development)
18
+ * [License](#license)
19
+
20
+ ## Installation
21
+
22
+ Add to your Gemfile:
23
+
24
+ ```ruby
25
+ gem 'irb-autosuggestions'
26
+ ```
27
+
28
+ `~/.irbrc`:
29
+
30
+ ```ruby
31
+ require 'irb-autosuggestions'
32
+ ```
33
+
34
+ ## Usage
35
+
36
+ Start typing in IRB. Gray ghost text appears after the cursor, showing the most recent matching history entry:
37
+
38
+ ```
39
+ irb(main):001* [1,2,3].map do |el|
40
+ irb(main):002* el.succ <- "cc" in gray
41
+ irb(main):003> end <- "d" in gray
42
+ ```
43
+
44
+ Press **right arrow** (`->`) to accept the full multiline suggestion.
45
+
46
+ ### How it works
47
+
48
+ - Each keystroke queries `Reline::HISTORY` for the most recent entry whose prefix matches the current buffer.
49
+ - The suggestion is rendered inline as gray (`\e[90m`) text without modifying the buffer.
50
+ - Extra ghost lines (for multiline history entries) are drawn below the prompt.
51
+ - `\e[J` clears stale ghost artifacts from the viewport.
52
+ - Right arrow triggers `ed_next_char`, which replaces the buffer with the ghost text.
53
+
54
+ ## Development
55
+
56
+ ```sh
57
+ bin/setup
58
+ bundle exec rake # spec + rubocop
59
+ ```
60
+
61
+ ## License
62
+
63
+ MIT
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/docscribe.yml ADDED
@@ -0,0 +1,92 @@
1
+ ---
2
+ # Docscribe configuration file
3
+ #
4
+ # Docscribe works without this file — create it only for customization.
5
+ #
6
+ # Quick start:
7
+ # bundle exec docscribe lib # check what would change
8
+ # bundle exec docscribe -a lib # apply safe updates
9
+ # bundle exec docscribe -A lib # rebuild all doc blocks
10
+
11
+ emit:
12
+ # What to include in generated documentation
13
+ header: false # +MyClass#foo+ -> ReturnType
14
+ param_tags: true # @param tags
15
+ return_tag: true # @return tag
16
+ visibility_tags: true # @private / @protected
17
+ raise_tags: true # @raise tags
18
+ rescue_conditional_returns: true # @return [Type] if Error
19
+ attributes: false # @!attribute for attr_*
20
+
21
+ # Placeholder text for generated docs
22
+ include_default_message: true # "Method documentation."
23
+ include_param_documentation: true # "Param documentation."
24
+
25
+ doc:
26
+ # Default text and formatting
27
+ default_message: "Method documentation."
28
+ param_documentation: "Param documentation."
29
+ param_tag_style: "type_name" # "type_name" or "name_type"
30
+ sort_tags: true
31
+ tag_order: ["todo", "note", "api", "private", "protected", "param", "option", "yieldparam", "raise", "return"]
32
+
33
+ inference:
34
+ # Type inference behavior
35
+ fallback_type: "Object" # when uncertain
36
+ nil_as_optional: true # String | nil => String?
37
+ treat_options_keyword_as_hash: true # options: keyword => Hash
38
+
39
+ filter:
40
+ # Which methods and files to process
41
+ # Method format: "Container#method" (instance) or "Container.method" (class)
42
+ # Supports globs ("*#initialize") and regex ("/^MyApp::.*$/")
43
+ include: []
44
+ exclude: []
45
+ visibilities: ["public", "protected", "private"]
46
+ scopes: ["instance", "class"]
47
+
48
+ files:
49
+ # File paths relative to project root (globs or /regex/)
50
+ include: []
51
+ exclude: ["spec"]
52
+
53
+ methods:
54
+ # Override defaults per scope and visibility.
55
+ # Empty {} means "use values from `doc` section".
56
+ #
57
+ # Example:
58
+ # instance:
59
+ # public:
60
+ # default_message: "Public API."
61
+ # private:
62
+ # return_tag: false
63
+ instance:
64
+ public: {}
65
+ protected: {}
66
+ private: {}
67
+ class:
68
+ public: {}
69
+ protected: {}
70
+ private: {}
71
+
72
+ rbs:
73
+ # Use RBS signatures for better types (requires `gem "rbs"`)
74
+ enabled: false
75
+ sig_dirs: ["sig"]
76
+ collection_dirs: [] # auto-discovered from --rbs-collection
77
+ collapse_generics: false # Hash<Symbol, String> => Hash
78
+ collection: false # auto-discover from rbs_collection.lock.yaml
79
+
80
+ sorbet:
81
+ # Use Sorbet inline sigs and RBI files for better types
82
+ enabled: false
83
+ rbi_dirs: ["sorbet/rbi", "rbi"]
84
+ collapse_generics: false
85
+
86
+ plugins:
87
+ # Load custom plugins
88
+ # Example:
89
+ # require:
90
+ # - ./docscribe_plugins
91
+ # - docscribe-rails-associations
92
+ require: []
@@ -0,0 +1,148 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Irb
4
+ module Autosuggestions
5
+ # Patches Reline::LineEditor to display fish-like autosuggestions from history.
6
+ module LineEditorPatch
7
+ GRAY = "\e[90m"
8
+ RESET = "\e[0m"
9
+
10
+ # Intercepts key input to accept autosuggestions on right arrow.
11
+ #
12
+ # @param [Object] key A Reline key event.
13
+ # @return [Object] Returns +super+ for non-right-arrow keys, +nil+ after accept.
14
+ def input_key(key)
15
+ if right_arrow?(key)
16
+ buffer = whole_buffer
17
+ suggestion = find_suggestion(buffer)
18
+
19
+ if suggestion && suggestion != buffer
20
+ accept_suggestion(suggestion)
21
+ return
22
+ end
23
+ end
24
+
25
+ super
26
+ end
27
+
28
+ private
29
+
30
+ # Injects ghost text into terminal output after Reline finishes rendering.
31
+ #
32
+ # @private
33
+ # @return [Object] The result of +super+.
34
+ def render(...)
35
+ result = super
36
+ Reline.core.instance_variable_get(:@output).write("\e[J")
37
+
38
+ buffer = whole_buffer
39
+ return result if buffer.empty?
40
+
41
+ ghost = ghost_for(buffer)
42
+ return result unless ghost
43
+
44
+ render_ghost(ghost)
45
+ result
46
+ end
47
+
48
+ # Checks if a key event is a right arrow press.
49
+ #
50
+ # @private
51
+ # @param [Object] key A Reline key event.
52
+ # @return [Boolean]
53
+ def right_arrow?(key)
54
+ key.respond_to?(:method_symbol) &&
55
+ key.method_symbol == :ed_next_char
56
+ end
57
+
58
+ # Computes the ghost text for a given buffer by finding the matching history entry.
59
+ #
60
+ # @private
61
+ # @param [String] buffer The current whole buffer.
62
+ # @return [String, nil] The remaining text of the suggestion, or nil.
63
+ def ghost_for(buffer)
64
+ suggestion = find_suggestion(buffer)
65
+ return unless suggestion
66
+
67
+ ghost = suggestion[buffer.size..]
68
+ return if ghost.nil? || ghost.empty?
69
+
70
+ ghost
71
+ end
72
+
73
+ # Writes the ghost text (inline + extra lines) to terminal output.
74
+ #
75
+ # @private
76
+ # @param [String] ghost The full ghost text (may contain newlines).
77
+ # @return [void]
78
+ def render_ghost(ghost)
79
+ lines = ghost.split("\n")
80
+
81
+ Reline.core.instance_variable_get(:@output).write("#{GRAY}#{lines.first}#{RESET}") unless lines.first.empty?
82
+
83
+ write_extra_ghost_lines(lines.drop(1))
84
+ restore_cursor_after(lines)
85
+
86
+ Reline.core.instance_variable_get(:@output).flush
87
+ end
88
+
89
+ # Writes extra ghost lines below the current buffer line with prompt-width alignment.
90
+ #
91
+ # @private
92
+ # @param [Array<String>] lines Extra ghost lines (excluding the first inline line).
93
+ # @return [void]
94
+ def write_extra_ghost_lines(lines)
95
+ return if lines.empty?
96
+
97
+ prompt_width = @prompt ? Reline::Unicode.calculate_width(@prompt) : 0
98
+ output = Reline.core.instance_variable_get(:@output)
99
+
100
+ lines.each do |line|
101
+ output.write("\n\e[K")
102
+ output.write("\e[#{prompt_width}C") if prompt_width.positive?
103
+ output.write("#{GRAY}#{line}#{RESET}")
104
+ end
105
+ end
106
+
107
+ # Restores the cursor to the end of the buffer after ghost rendering.
108
+ #
109
+ # @private
110
+ # @param [Array<String>] lines The ghost split into lines.
111
+ # @return [void]
112
+ def restore_cursor_after(lines)
113
+ extra_count = lines.size - 1
114
+ prompt_width = @prompt ? Reline::Unicode.calculate_width(@prompt) : 0
115
+ pos = prompt_width + (@buffer_of_lines[@line_index] || '').length
116
+ output = Reline.core.instance_variable_get(:@output)
117
+
118
+ output.write("\e[#{extra_count}A") if extra_count.positive?
119
+ output.write("\e[0G")
120
+ output.write("\e[#{pos}C")
121
+ end
122
+
123
+ # Finds the most recent history entry that starts with the given buffer.
124
+ #
125
+ # @private
126
+ # @param [String] buffer The current whole buffer.
127
+ # @return [String, nil] The matching history entry, or nil.
128
+ def find_suggestion(buffer)
129
+ Reline::HISTORY.reverse.find do |h|
130
+ h != buffer && h.start_with?(buffer)
131
+ end
132
+ end
133
+
134
+ # Replaces the entire buffer with the accepted suggestion and triggers a rerender.
135
+ #
136
+ # @private
137
+ # @param [String] suggestion The full multiline suggestion to accept.
138
+ # @return [void]
139
+ def accept_suggestion(suggestion)
140
+ sug_lines = suggestion.split("\n")
141
+ @buffer_of_lines = sug_lines
142
+ @line_index = sug_lines.size - 1
143
+ @byte_pointer = sug_lines.last.bytesize
144
+ rerender
145
+ end
146
+ end
147
+ end
148
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Irb
4
+ module Autosuggestions
5
+ VERSION = '0.1.0'
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'reline'
4
+
5
+ require_relative 'autosuggestions/version'
6
+ require_relative 'autosuggestions/line_editor_patch'
7
+
8
+ Reline::LineEditor.prepend(Irb::Autosuggestions::LineEditorPatch)
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'irb/autosuggestions'
@@ -0,0 +1,140 @@
1
+ ---
2
+ path: ".gem_rbs_collection"
3
+ gems:
4
+ - name: ast
5
+ version: '2.4'
6
+ source:
7
+ type: git
8
+ name: ruby/gem_rbs_collection
9
+ revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
10
+ remote: https://github.com/ruby/gem_rbs_collection.git
11
+ repo_dir: gems
12
+ - name: diff-lcs
13
+ version: '1.5'
14
+ source:
15
+ type: git
16
+ name: ruby/gem_rbs_collection
17
+ revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
18
+ remote: https://github.com/ruby/gem_rbs_collection.git
19
+ repo_dir: gems
20
+ - name: fileutils
21
+ version: '0'
22
+ source:
23
+ type: stdlib
24
+ - name: io-console
25
+ version: '0'
26
+ source:
27
+ type: stdlib
28
+ - name: json
29
+ version: '0'
30
+ source:
31
+ type: stdlib
32
+ - name: lint_roller
33
+ version: '1.1'
34
+ source:
35
+ type: git
36
+ name: ruby/gem_rbs_collection
37
+ revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
38
+ remote: https://github.com/ruby/gem_rbs_collection.git
39
+ repo_dir: gems
40
+ - name: logger
41
+ version: '1.7'
42
+ source:
43
+ type: git
44
+ name: ruby/gem_rbs_collection
45
+ revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
46
+ remote: https://github.com/ruby/gem_rbs_collection.git
47
+ repo_dir: gems
48
+ - name: monitor
49
+ version: '0'
50
+ source:
51
+ type: stdlib
52
+ - name: optparse
53
+ version: '0'
54
+ source:
55
+ type: stdlib
56
+ - name: parallel
57
+ version: '1.20'
58
+ source:
59
+ type: git
60
+ name: ruby/gem_rbs_collection
61
+ revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
62
+ remote: https://github.com/ruby/gem_rbs_collection.git
63
+ repo_dir: gems
64
+ - name: parser
65
+ version: '3.2'
66
+ source:
67
+ type: git
68
+ name: ruby/gem_rbs_collection
69
+ revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
70
+ remote: https://github.com/ruby/gem_rbs_collection.git
71
+ repo_dir: gems
72
+ - name: prism
73
+ version: 1.9.0
74
+ source:
75
+ type: rubygems
76
+ - name: rainbow
77
+ version: '3.0'
78
+ source:
79
+ type: git
80
+ name: ruby/gem_rbs_collection
81
+ revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
82
+ remote: https://github.com/ruby/gem_rbs_collection.git
83
+ repo_dir: gems
84
+ - name: rake
85
+ version: '13.0'
86
+ source:
87
+ type: git
88
+ name: ruby/gem_rbs_collection
89
+ revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
90
+ remote: https://github.com/ruby/gem_rbs_collection.git
91
+ repo_dir: gems
92
+ - name: rbs
93
+ version: 4.0.2
94
+ source:
95
+ type: rubygems
96
+ - name: rdoc
97
+ version: '0'
98
+ source:
99
+ type: stdlib
100
+ - name: regexp_parser
101
+ version: '2.8'
102
+ source:
103
+ type: git
104
+ name: ruby/gem_rbs_collection
105
+ revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
106
+ remote: https://github.com/ruby/gem_rbs_collection.git
107
+ repo_dir: gems
108
+ - name: ripper
109
+ version: '0'
110
+ source:
111
+ type: stdlib
112
+ - name: rubocop
113
+ version: '1.57'
114
+ source:
115
+ type: git
116
+ name: ruby/gem_rbs_collection
117
+ revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
118
+ remote: https://github.com/ruby/gem_rbs_collection.git
119
+ repo_dir: gems
120
+ - name: rubocop-ast
121
+ version: '1.46'
122
+ source:
123
+ type: git
124
+ name: ruby/gem_rbs_collection
125
+ revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
126
+ remote: https://github.com/ruby/gem_rbs_collection.git
127
+ repo_dir: gems
128
+ - name: tsort
129
+ version: '0'
130
+ source:
131
+ type: stdlib
132
+ - name: yard
133
+ version: '0.9'
134
+ source:
135
+ type: git
136
+ name: ruby/gem_rbs_collection
137
+ revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
138
+ remote: https://github.com/ruby/gem_rbs_collection.git
139
+ repo_dir: gems
140
+ gemfile_lock_path: Gemfile.lock
@@ -0,0 +1,19 @@
1
+ # Download sources
2
+ sources:
3
+ - type: git
4
+ name: ruby/gem_rbs_collection
5
+ remote: https://github.com/ruby/gem_rbs_collection.git
6
+ revision: main
7
+ repo_dir: gems
8
+
9
+ # You can specify local directories as sources also.
10
+ # - type: local
11
+ # path: path/to/your/local/repository
12
+
13
+ # A directory to install the downloaded RBSs
14
+ path: .gem_rbs_collection
15
+
16
+ # gems:
17
+ # # If you want to avoid installing rbs files for gems, you can specify them here.
18
+ # - name: GEM_NAME
19
+ # ignore: true
data/readme.png ADDED
Binary file
@@ -0,0 +1,22 @@
1
+ module Irb
2
+ module Autosuggestions
3
+ module LineEditorPatch
4
+ GRAY: String
5
+ RESET: String
6
+
7
+ @buffer_of_lines: Array[String]
8
+ @byte_pointer: Integer
9
+ @line_index: Integer
10
+
11
+ def input_key: (untyped key) -> untyped
12
+ def render: (*untyped) -> untyped
13
+ def right_arrow?: (untyped key) -> bool
14
+ def ghost_for: (String buffer) -> (String | nil)
15
+ def render_ghost: (String ghost) -> void
16
+ def write_extra_ghost_lines: (Array[String] lines) -> void
17
+ def restore_cursor_after: (Array[String] lines) -> void
18
+ def find_suggestion: (String buffer) -> (String | nil)
19
+ def accept_suggestion: (String suggestion) -> void
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,5 @@
1
+ module Irb
2
+ module Autosuggestions
3
+ VERSION: String
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,205 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: irb-autosuggestions
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - unurgunite
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2026-05-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: reline
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: docscribe
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rbs
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-sorted_methods_by_call
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: yard
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: 0.9.38
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: 0.9.38
153
+ description: Fish-like autosuggestions for irb.
154
+ email:
155
+ executables: []
156
+ extensions: []
157
+ extra_rdoc_files: []
158
+ files:
159
+ - ".rspec"
160
+ - ".rubocop.yml"
161
+ - ".ruby-version"
162
+ - CODE_OF_CONDUCT.md
163
+ - Gemfile
164
+ - Gemfile.lock
165
+ - LICENSE.txt
166
+ - README.md
167
+ - Rakefile
168
+ - docscribe.yml
169
+ - lib/irb-autosuggestions.rb
170
+ - lib/irb/autosuggestions.rb
171
+ - lib/irb/autosuggestions/line_editor_patch.rb
172
+ - lib/irb/autosuggestions/version.rb
173
+ - rbs_collection.lock.yaml
174
+ - rbs_collection.yaml
175
+ - readme.png
176
+ - sig/lib/irb/autosuggestions/line_editor_patch.rbs
177
+ - sig/lib/irb/autosuggestions/version.rbs
178
+ homepage: https://github.com/unurgunite/irb-autosuggestions
179
+ licenses:
180
+ - MIT
181
+ metadata:
182
+ homepage_uri: https://github.com/unurgunite/irb-autosuggestions
183
+ source_code_uri: https://github.com/unurgunite/irb-autosuggestions
184
+ changelog_uri: https://github.com/unurgunite/irb-autosuggestions
185
+ rubygems_mfa_required: 'true'
186
+ post_install_message:
187
+ rdoc_options: []
188
+ require_paths:
189
+ - lib
190
+ required_ruby_version: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '3.0'
195
+ required_rubygems_version: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ requirements: []
201
+ rubygems_version: 3.5.23
202
+ signing_key:
203
+ specification_version: 4
204
+ summary: Fish-like autosuggestions for irb.
205
+ test_files: []