lob / lob-ruby

Ruby Wrapper for Lob API
lob.com
MIT License
97 stars 43 forks source link

Fix regex warning in bank_account.rb #225

Open arich opened 10 months ago

arich commented 10 months ago

Hi!

I'm getting this error when including this gem in my Rails project.

/Users/arich/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/bundler/gems/lob-ruby/lib/openapi_client/models/bank_account.rb: warning: character class has '-' without escape

Most of the changes here are just consolidating the multiple definitions of the same long regex to a single method. I can undo that if it's not helpful.

The change in detail: Before: [a-zA-Z0-9-_]+/

After: [a-zA-Z0-9\-_]+/

We're just escaping the - as a character you want to include in this regex.

image

shayani commented 8 months ago

That would be nice. I'm getting tired of seeing this warning every time I run anything on my Rails project.

Is there a way to do not display the warning until this PR is merged?

mrkaspa commented 4 months ago

I created this PR for solving the same https://github.com/lob/lob-ruby/pull/237