-
Notifications
You must be signed in to change notification settings - Fork 0
Comparing changes
Open a pull request
base repository: ashishmax31/immutable-ruby
base: master
head repository: immutable-ruby/immutable-ruby
compare: master
- 13 commits
- 13 files changed
- 2 contributors
Commits on Nov 28, 2021
-
Fix tests for Immutable.to_ruby for Ruby 3.0
In Ruby 2, SortedSet was part of the standard library. In Ruby 3, it was removed from stdlib and put into a gem. This new gem implements SortedSet using RBTree (from the 'rbtree' gem). As a result, the behavior of `SortedSet#eql?` has changed; two SortedSets only compare as equal using `#eql?` if they are the same object, not if their contents are the same. This behavior does not match built-in Ruby data structures like `Hash` and is arguably incorrect. It was reported as an issue in the GitHub repository for `sorted_set` almost a year ago, but has not been fixed. We would love to see this issue with the new `sorted_set` gem fixed, but in the meantime, we can simply avoid using `SortedSet#eql?` for testing equality in our specs.
Configuration menu - View commit details
-
Copy full SHA for a8acf28 - Browse repository at this point
Copy the full SHA a8acf28View commit details -
Check arity of comparator block for SortedSet correctly for Ruby 3.0
The behavior of `&:method` blocks has changed in Ruby 3.0. Previously they had arity -1; now it's -2. I don't know the reason for this change. While we fix that, we can also be more strict in rejecting blocks with an arity which we can't use. These would result in an exception anyways, but it will be better to raise an exception with a more understandable error message.
Configuration menu - View commit details
-
Copy full SHA for 4fddf90 - Browse repository at this point
Copy the full SHA 4fddf90View commit details -
Fix SortedSet#eql? for Ruby 3.0
It seems that the behavior of `Kernel#loop` might have changed a bit in Ruby 3.0. Adjust `SortedSet#eql?` accordingly.
Configuration menu - View commit details
-
Copy full SHA for 952d11a - Browse repository at this point
Copy the full SHA 952d11aView commit details -
Configuration menu - View commit details
-
Copy full SHA for ead7d2a - Browse repository at this point
Copy the full SHA ead7d2aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c13a63 - Browse repository at this point
Copy the full SHA 5c13a63View commit details -
Use sorted_set gem to implement Immutable.{from,to_ruby} on Ruby 3.0
Ruby's SortedSet used to be included in set.rb (standard library). Starting from Ruby 3.0, it's not. Rather, it has been broken out into a gem. So to keep the one part of `Immutable` which references SortedSet working, we need to pull in that gem. I don't like this, but it's better than potentially breaking user code.
Configuration menu - View commit details
-
Copy full SHA for fe64cb2 - Browse repository at this point
Copy the full SHA fe64cb2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 18555a2 - Browse repository at this point
Copy the full SHA 18555a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84dba73 - Browse repository at this point
Copy the full SHA 84dba73View commit details -
Remove unneeded code from
SortedSet#eql?In the commit message for 952d11a, I wrongly suggested that the code for this method needed to be adjusted for Ruby 3.0. It seems that rather, I had broken it when refactoring uses of `while true` loops to use the `loop` method instead. With that change, the final `rescue` clause became dead code.
Configuration menu - View commit details
-
Copy full SHA for f5d060c - Browse repository at this point
Copy the full SHA f5d060cView commit details
Commits on Feb 9, 2022
-
Configuration menu - View commit details
-
Copy full SHA for e97c749 - Browse repository at this point
Copy the full SHA e97c749View commit details
Commits on Apr 20, 2024
-
Break circular dependency loops caused by Hash/Vector/Set all requiri…
…ng each other Thanks to Sean Collins for reporting that he was getting the following warning when using Immutable::Hash: immutable-ruby/lib/immutable/vector.rb:2: warning: immutable-ruby/lib/immutable/vector.rb:2: warning: loading in progress, circular require considered harmful - immutable-ruby/lib/immutable/hash.rb To break the loop, move the definitions of Immutable::Hash, Immutable::Vector, and Immutable::Set (all of which depend on each other) into a new file, which is required from hash.rb, vector.rb, and set.rb, but which doesn't require any of those files itself.Configuration menu - View commit details
-
Copy full SHA for d8874cf - Browse repository at this point
Copy the full SHA d8874cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 59fb969 - Browse repository at this point
Copy the full SHA 59fb969View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d20d25 - Browse repository at this point
Copy the full SHA 7d20d25View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master...master