Skip to content
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

cli_parser: Add class method to make options declaration more readable #3980

Merged
merged 1 commit into from
Mar 25, 2018

Conversation

GauthamGoli
Copy link
Contributor

  • 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 written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

#1860
#3971 (comment)

@@ -4,6 +4,12 @@
module Homebrew
module CLI
class Parser
class << self
def parse(&block)
Copy link
Member

Choose a reason for hiding this comment

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

def self.parse(&block) would work, right?

Copy link
Contributor Author

@GauthamGoli GauthamGoli Mar 25, 2018

Choose a reason for hiding this comment

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

yeah, but I read class << self way is more popular in RoR codebase 😬

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nevermind. Changing it to def self.parse(&block)

@GauthamGoli GauthamGoli force-pushed the arg-parser-refactor branch from f6de9e4 to ed38757 Compare March 25, 2018 12:32
@MikeMcQuaid MikeMcQuaid merged commit f37b0bc into Homebrew:master Mar 25, 2018
@MikeMcQuaid
Copy link
Member

Thanks again @GauthamGoli!

@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.

2 participants