File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ ruby version, and the gem path"
164
164
(defun chruby-use (ruby-version )
165
165
" choose what ruby you want to activate"
166
166
(interactive
167
- (let ((picked-ruby (read-string " Ruby version: " )))
167
+ (let ((picked-ruby (completing-read " Ruby version: " (chruby--available-names) )))
168
168
(list picked-ruby)))
169
169
(if (chruby-activate ruby-version)
170
170
(message (concat " [chruby] using " ruby-version))
@@ -178,6 +178,10 @@ ruby version, and the gem path"
178
178
(if version-file-path (chruby-use (chruby--read-version-from-file version-file-path))
179
179
(message " [chruby] could not locate .ruby-version " ))))
180
180
181
+ (defun chruby--available-names ()
182
+ " list of available ruby names without path, higher versions sorted first"
183
+ (reverse (mapcar 'chruby-util-basename (chruby-rubies))))
184
+
181
185
(defun chruby--replace-trailing-whitespace (text )
182
186
(replace-regexp-in-string " [[:space:]]\\ '" " " text))
183
187
You can’t perform that action at this time.
0 commit comments