[ruby/ipaddr] Expose IPAddr::VERSION
An almost universal convention for gems is to expose Namespace::VERSION which makes it much easier when debugging etc. https://github.com/ruby/ipaddr/commit/587ae6996e
This commit is contained in:
parent
fd710d7e99
commit
5221cb4468
@ -3,9 +3,13 @@
|
|||||||
lib = File.expand_path("../lib", __FILE__)
|
lib = File.expand_path("../lib", __FILE__)
|
||||||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||||
|
|
||||||
|
version = File.foreach(File.expand_path("ipaddr.rb", lib)).find do |line|
|
||||||
|
/^\s*VERSION\s*=\s*["'](.*)["']/ =~ line and break $1
|
||||||
|
end
|
||||||
|
|
||||||
Gem::Specification.new do |spec|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "ipaddr"
|
spec.name = "ipaddr"
|
||||||
spec.version = "1.2.3"
|
spec.version = version
|
||||||
spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"]
|
spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"]
|
||||||
spec.email = ["knu@idaemons.org", "ume@mahoroba.org"]
|
spec.email = ["knu@idaemons.org", "ume@mahoroba.org"]
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ require 'socket'
|
|||||||
# p ipaddr3 #=> #<IPAddr: IPv4:192.168.2.0/255.255.255.0>
|
# p ipaddr3 #=> #<IPAddr: IPv4:192.168.2.0/255.255.255.0>
|
||||||
|
|
||||||
class IPAddr
|
class IPAddr
|
||||||
|
VERSION = "1.2.3"
|
||||||
|
|
||||||
# 32 bit mask for IPv4
|
# 32 bit mask for IPv4
|
||||||
IN4MASK = 0xffffffff
|
IN4MASK = 0xffffffff
|
||||||
|
Loading…
x
Reference in New Issue
Block a user