allows negative numeric arguments #429

Merged
merged 2 commits into from Oct 29, 2014

Conversation

Projects
None yet
2 participants
@hstove
Contributor

hstove commented Aug 1, 2014

This PR completely rips the code from #329 because I'd love to use it. Thanks to @jeromedecoster for this!

lib/thor/parser/arguments.rb
@@ -1,6 +1,6 @@
class Thor
class Arguments #:nodoc: # rubocop:disable ClassLength
- NUMERIC = /(\d*\.\d+|\d+)/
+ NUMERIC = /[-+]{0,1}(\d*\.\d+|\d+)/

This comment has been minimized.

@sferik

sferik Oct 29, 2014

Member

I’d recommend using ? instead of {0,1} (means the same thing, just shorter). Other than that, looks good to me.

@sferik

sferik Oct 29, 2014

Member

I’d recommend using ? instead of {0,1} (means the same thing, just shorter). Other than that, looks good to me.

This comment has been minimized.

@hstove

hstove Oct 29, 2014

Contributor

Good call! Changed

@hstove

hstove Oct 29, 2014

Contributor

Good call! Changed

sferik added a commit that referenced this pull request Oct 29, 2014

Merge pull request #429 from hstove/master
allows negative numeric arguments

@sferik sferik merged commit e5e77c4 into erikhuda:master Oct 29, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@sferik

This comment has been minimized.

Show comment
Hide comment
@sferik

sferik Oct 29, 2014

Member

Thanks!

Member

sferik commented Oct 29, 2014

Thanks!

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