diff --git a/lib/yarp/yarp.gemspec b/lib/yarp/yarp.gemspec index 671eddc7a2..b04f893d04 100644 --- a/lib/yarp/yarp.gemspec +++ b/lib/yarp/yarp.gemspec @@ -1,6 +1,12 @@ # frozen_string_literal: true -require_relative 'lib/yarp/version' +if File.exist?(File.expand_path("version.rb", __dir__)) + # CRuby + require_relative "version" +else + # Within the gem/local repository + require_relative "lib/yarp/version" +end Gem::Specification.new do |spec| spec.name = "yarp"