Skip to content

Use completing-read in interactive prompt for ruby version #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 22, 2016

Conversation

til
Copy link
Contributor

@til til commented Dec 22, 2016

One more 😄 .

This way one does not have to guess or remember which rubies are available. Works for me with helm, and also without helm.

@@ -174,6 +174,10 @@ ruby version, and the gem path"
(if version-file-path (chruby-use (chruby--read-version-from-file version-file-path))
(message "[chruby] could not locate .ruby-version"))))

(defun chruby--available-names ()
"list of available ruby names without path, higher versions sorted first"
(reverse (cl-mapcar 'chruby-util-basename (chruby-rubies))))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need cl-mapcar here, regular mapcar should do.

From the manual

Given a single seq argument it is equivalent to mapcar; given n sequences, it calls the function with the first elements of each of the sequences as the n arguments to yield the first element of the result list, then with the second elements, and so on.

@til
Copy link
Contributor Author

til commented Dec 22, 2016 via email

@til til force-pushed the use-completing-read branch from 8f3dd2c to 1f95a82 Compare December 22, 2016 12:03
@plexus
Copy link
Owner

plexus commented Dec 22, 2016

Thanks for the PR! Definitely an improvement. I now remember why these functions weren't documented. They were contributed by someone else, and I guess that person didn't update the docs. I had forgotten they even existed :)

Yeah, in general I'd say only use the cl functions when there's no regular alternative. But it doesn't matter so much to be honest. I just added cl-lib as an explicit dependency now, that wasn't the case yet.

@til
Copy link
Contributor Author

til commented Dec 22, 2016 via email

@plexus plexus merged commit 04182d6 into plexus:master Dec 22, 2016
@plexus
Copy link
Owner

plexus commented Dec 22, 2016

cake

yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants