-
Notifications
You must be signed in to change notification settings - Fork 15
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
Name lib/ top-level file to match expected require #144
Conversation
In 00312b9 the namespace of this gem was converted from `statistics` to `ruby-statistics`. This includes the instructions for requiring the entire gem to use `require 'ruby-statistics'`. However, that file does not exist in the gem. The `lib/statistics.rb` file still existed. And in tests for the gem, that file was still being loaded. As a result the tests were still passing after the change. To be in agreement with the documentation and the upgrade path, this creates a `lib/ruby-statistics.rb` file. That is loaded in tests to confirm the behavior we are documenting in the README. This file naming is a bit unconventional, as we may expect to be using underscore to separate the words. That would also be consistent with RubyGem's [naming guide](https://guides.rubygems.org/name-your-gem/). However, the gem name is already defined and considered out of scope for this change. We *can* make this file `lib/ruby_statistics.rb`. That would match a Ruby conventional file-naming scheme. As a result of that, we would update the documentation to `require 'ruby-statistics'`. I would also advocate for changing the `ruby-statistics` directory to `ruby_statistics`. Doing that would have inconsistency between the gem name and what's being required, though some of it would be more conventional. Rather than making those sweeping changes, this proposes creating this file so that the gem can be required as the README suggests.
Hi @kevin-j-m thank you so much for this PR! I thought it was something on my env as I couldn't replicate this behaviour constantly on my end. I'll give some tests and let you know how it goes. Thank you! |
Alright, I did some tests and it looks good. You're missing one spot, so if you can add it to the PR I really appreciate it! https://github.com/estebanz01/ruby-statistics/blob/master/bin/console |
@estebanz01 I pushed 14c295f to include the console change. Let me know if you need anything else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll merge today and release a patch version tonight or tomorrow.
I really appreaciate the contribution! 🎉
This change includes the fix reported in #144 by @kevin-j-m Thanks!
In 00312b9 the namespace of this gem was converted from
statistics
toruby-statistics
. This includes the instructions for requiring the entire gem to userequire 'ruby-statistics'
. However, that file does not exist in the gem.The
lib/statistics.rb
file still existed. And in tests for the gem, that file was still being loaded. As a result the tests were still passing after the change.To be in agreement with the documentation and the upgrade path, this creates a
lib/ruby-statistics.rb
file. That is loaded in tests to confirm the behavior we are documenting in the README.This file naming is a bit unconventional, as we may expect to be using underscore to separate the words. That would also be consistent with RubyGem's naming guide. However, the gem name is already defined and considered out of scope for this change.
We can make this file
lib/ruby_statistics.rb
. That would match a Ruby conventional file-naming scheme. As a result of that, we would update the documentation torequire 'ruby_statistics'
. I would also advocate for changing theruby-statistics
directory toruby_statistics
.Doing that would have inconsistency between the gem name and what's being required, though some of it would be more conventional.
Rather than making those sweeping changes, this proposes creating this file so that the gem can be required as the README suggests.