We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6edf6ee + 9385bd8 commit 8d48efeCopy full SHA for 8d48efe
ipaddr.gemspec
@@ -1,9 +1,17 @@
1
# frozen_string_literal: true
2
# coding: utf-8
3
-lib = File.expand_path("../lib", __FILE__)
4
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
6
-version = File.foreach(File.expand_path("ipaddr.rb", lib)).find do |line|
+if File.exist?(File.expand_path("ipaddr.gemspec"))
+ lib = File.expand_path("../lib", __FILE__)
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
7
+
8
+ file = File.expand_path("ipaddr.rb", lib)
9
+else
10
+ # for ruby-core
11
+ file = File.expand_path("ipaddr.rb")
12
+end
13
14
+version = File.foreach(file).find do |line|
15
/^\s*VERSION\s*=\s*["'](.*)["']/ =~ line and break $1
16
end
17
0 commit comments