Skip to content

Conversation

@DomT4
Copy link
Contributor

@DomT4 DomT4 commented Oct 18, 2017

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run brew tests with your changes locally?

Noticed in this that DS_Store was getting chucked in with the commands list 🤷‍♂️.

@ilovezfs
Copy link
Contributor

not all dot files?

@DomT4
Copy link
Contributor Author

DomT4 commented Oct 18, 2017

I can if you want? Just thought this was the only one that seemed likely to end up inside a cmd folder unless someone is doing something a little strange with their tap/etc.

@ilovezfs
Copy link
Contributor

It will currently list e.g. .info.rb.swp so I would do all dot files, yeah

@DomT4
Copy link
Contributor Author

DomT4 commented Oct 18, 2017

Alright. One sec.

@DomT4 DomT4 changed the title commands: filter out DS_Store files from output commands: filter out dotfiles from output Oct 18, 2017
@reitermarkus
Copy link
Member

How about

  Pathname.glob(directory/"*")
          .select(&:file?)
          .map { |f| f.basename.to_s.sub(/\.(?:rb|sh)$/, "") }

?

@DomT4
Copy link
Contributor Author

DomT4 commented Oct 18, 2017

I don't have a major objection if people prefer that format. Whatever folks are happy with. I am not a huge fan of chaining together across multiple lines like that but it's become a common enough thing I can't really start complaining about it now 😄.

@reitermarkus
Copy link
Member

I find it easier to follow than a next inside an if inside an each_with_object. 😉

@DomT4
Copy link
Contributor Author

DomT4 commented Oct 18, 2017

@ilovezfs Any objections? Keen to avoid getting in the middle of a maintainer disagreement over style. I don't miss those 😅.

Use a more typical Ruby style.
@MikeMcQuaid
Copy link
Member

Thanks @DomT4 and @reitermarkus!

@MikeMcQuaid MikeMcQuaid merged commit a2374cb into Homebrew:master Oct 20, 2017
@DomT4 DomT4 deleted the ds_store_is_not_a_command branch October 20, 2017 22:17
@DomT4
Copy link
Contributor Author

DomT4 commented Oct 20, 2017

Thanks for merging Mike. Was trying to give ILZ a little bit to see if he had any objections, but I'm assuming we're good.

@ilovezfs
Copy link
Contributor

LGTM. Thanks, Mr. T

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants