Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose IPAddr::VERSION #33

Merged
merged 1 commit into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ipaddr.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
lib = File.expand_path("../lib", __FILE__)
$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|
spec.name = "ipaddr"
spec.version = "1.2.3"
spec.version = version
spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"]
spec.email = ["knu@idaemons.org", "ume@mahoroba.org"]

Expand Down
1 change: 1 addition & 0 deletions lib/ipaddr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
# p ipaddr3 #=> #<IPAddr: IPv4:192.168.2.0/255.255.255.0>

class IPAddr
VERSION = "1.2.3"

# 32 bit mask for IPv4
IN4MASK = 0xffffffff
Expand Down