cyu / rack-cors

Rack Middleware for handling Cross-Origin Resource Sharing (CORS), which makes cross-origin AJAX possible.
MIT License
3.26k stars 263 forks source link

Refactor into one class per file, add Rubocop #202

Closed MXfive closed 4 years ago

MXfive commented 4 years ago

While debugging issues with this gem, I pulled out each class into its own file to make it easier to comprehend and jump around. After all our issues were sorted I decided to run it through Rubocop and update it to conform with as many styles as possible without fundamentally changing the flow or how the gem is put together.

Also dropped long deprecated Ruby 2.2 and added Ruby 2.7 as Rubocop requires 2.3 minimum.

Travis configured to run Rubocop and test suite, previously was inferring how to run the test suite automatically.

cyu commented 4 years ago

Thanks, @MXfive - there's a lot of changes here, I'll need some time to review.

Can you remove the rubocop changes to the Rails 5 example an add an exclusion for it? I want the Rails 5 example to match the results of rails new as much as possible to make the relevant changes obvious.

MXfive commented 4 years ago

@cyu Done. I already added an exclusion, but that was after my first pass with the auto corrector 😅