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

Ruby defArgs omit regex actually includes no-arg methods in omit #50

Closed
willbryant opened this Issue Feb 10, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@willbryant

willbryant commented Feb 10, 2014

irb(main):001:0> "def foo" =~ /^[\s\t]*def\s+\w+\s*[^()]*(#+.*)*$/
=> 0

So we need a \w in there somewhere, how about:

/^[\s\t]*def\s+\w+\s+\w[^()]*(#+.*)*$/

Seems to work better:

irb(main):006:0> "def foo" =~ /^[\s\t]*def\s+\w+\s+\w[^()]*(#+.*)*$/
=> nil
irb(main):007:0> "def foo(a, b)" =~ /^[\s\t]*def\s+\w+\s+\w[^()]*(#+.*)*$/
=> nil
irb(main):008:0> "def foo a, b" =~ /^[\s\t]*def\s+\w+\s+\w[^()]*(#+.*)*$/
=> 0
@outsideris

This comment has been minimized.

Owner

outsideris commented Feb 12, 2014

@willbryant
you are right. I was think about no-arg.
Thanks.

@outsideris outsideris self-assigned this Feb 12, 2014

@outsideris outsideris added the bug label Feb 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment