Skip to content

Commit ab66d73

Browse files
luk4sjfelchner
authored andcommitted
Change: Issue Caused By Ruby Bug
Why This Change Is Necessary ======================================================================== When `require 'enumerator'` is used in code, it somehow ends up causing `LoadError: cannot load such file -- enumerator` errors. I believe this is caused by a [ruby issue][3] but it's since been merged and still appears to be a problem so I'm just going to try to resolve it myself. What These Changes Do To Address the Issue ======================================================================== I believe this should be caused entirely by the name of the file and not by the name of the class. I'm going to attempt to rename the file and see if that fixes the issue. The `refinements.rb` file has been updated to load the proper file and the filenames have been renamed. Caveats ------------------------------------------------------------------------ Technically this is a backwards-incompatible change because someone somewhere could be manually loading the refinement, but seeing as how it is currently loaded immediately when the gem loads, I don't see that as a common occurrence. We are also being bad and not renaming the module to reflect the class name, but I think it's worth it to get the fix in without a major breaking change. Side Effects Caused By This Change ======================================================================== Users who are manually requiring the enumerator refinement file, will start to break. ------------------------------------------------------------------------ **Relevant URLs:** * [Issue Link][1] * [PR Link][2] * [Ruby Issue][3] **Actions:** * Closes 175 * Closes 176 ------------------------------------------------------------------------ [1]: #175 [2]: #176 [3]: https://bugs.ruby-lang.org/issues/10902
1 parent 2616f99 commit ab66d73

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
require 'ruby-progressbar/refinements/enumerator'
1+
require 'ruby-progressbar/refinements/progress_enumerator'
File renamed without changes.

spec/lib/ruby-progressbar/refinements/enumerator_spec.rb renamed to spec/lib/ruby-progressbar/refinements/progress_enumerator_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
if Module.private_instance_methods.include?(:using)
22

33
require 'spec_helper'
4-
require 'ruby-progressbar/refinements/enumerator'
4+
require 'ruby-progressbar/refinements/progress_enumerator'
55

66
class ProgressBar
77
module Refinements

0 commit comments

Comments
 (0)