diff options
author | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2019-12-05 18:14:31 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2019-12-05 18:18:55 +0900 |
commit | 4c88107c54b06c1a3e89970eb243c8ac887d84e1 (patch) | |
tree | d915e633fa88d1fe8b3775980ee309e81e772848 /lib/did_you_mean/did_you_mean.gemspec | |
parent | 75b644350a80bc31449b7cee741d309643dc27e1 (diff) |
Fix `warning: already initialized constant DidYouMean::VERSION`
```
.../gems/did_you_mean-1.3.1/lib/did_you_mean/version.rb:2: warning: already initialized constant DidYouMean::VERSION
.../lib/did_you_mean/version.rb:2: warning: previous definition of VERSION was here
```
Diffstat (limited to 'lib/did_you_mean/did_you_mean.gemspec')
-rw-r--r-- | lib/did_you_mean/did_you_mean.gemspec | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/did_you_mean/did_you_mean.gemspec b/lib/did_you_mean/did_you_mean.gemspec index 8a74db8cc4..8fe5723129 100644 --- a/lib/did_you_mean/did_you_mean.gemspec +++ b/lib/did_you_mean/did_you_mean.gemspec @@ -1,7 +1,11 @@ # coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'did_you_mean/version' +begin + require_relative "lib/did_you_mean/version" +rescue LoadError # Fallback to load version file in ruby core repository + require_relative "version" +end Gem::Specification.new do |spec| spec.name = "did_you_mean" |