-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change HashDiff Constant to Hashdiff
Why This Change Is Necessary ======================================================================== The name of this gem is `hashdiff`. There is another gem named `hash_diff`. When they are both required via dependencies, errors are thrown. Additionally since the behavior is different, gems that are relying on `hashdiff`'s behavior, may get `hash_diff`'s behavior and vice versa. The reason for the conflict is because, based on ruby conventions, _'s are the separators for camel case. So: ```ruby 'hashdiff'.camelize # => "Hashdiff" 'hash_diff'.camelize # => "HashDiff" ``` Unfortunately instead of making the base module of this gem `Hashdiff`, it's called `HashDiff` and it conflicts. How These Changes Address the Issue ======================================================================== We change all of the constants to the new constant, including in documentation and tests. Then we add a shim to allow the old constant to be used and therefore maintain backward compatibility. Finally we add a warning message for users of the gem that the old constant will be removed in the next major version bump. Side Effects Caused By This Change ======================================================================== A new warning is added when loading the gem.
- Loading branch information
Showing
19 changed files
with
67 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,16 +5,17 @@ require 'hashdiff/version' | |
|
||
Gem::Specification.new do |s| | ||
s.name = 'hashdiff' | ||
s.version = HashDiff::VERSION | ||
s.version = Hashdiff::VERSION | ||
s.license = 'MIT' | ||
s.summary = ' HashDiff is a diff lib to compute the smallest difference between two hashes. ' | ||
s.description = ' HashDiff is a diff lib to compute the smallest difference between two hashes. ' | ||
s.summary = ' Hashdiff is a diff lib to compute the smallest difference between two hashes. ' | ||
s.description = ' Hashdiff is a diff lib to compute the smallest difference between two hashes. ' | ||
|
||
s.files = `git ls-files`.split("\n") | ||
s.test_files = `git ls-files -- Appraisals {spec}/*`.split("\n") | ||
|
||
s.require_paths = ['lib'] | ||
s.required_ruby_version = Gem::Requirement.new('>= 2.0.0') | ||
s.post_install_message = 'The HashDiff constant used by this gem conflicts with another gem of a similar name. As of version 1.0 the HashDiff constant will be completely removed and replaced by Hashdiff. For more information see https://github.com/liufengyun/hashdiff/issues/45.' | ||
|
||
s.authors = ['Liu Fengyun'] | ||
s.email = ['[email protected]'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.