Skip to content

Commit

Permalink
Expose Resolv::VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Apr 14, 2023
1 parent 1fade4b commit 6ab2385
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/resolv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

class Resolv

VERSION = "0.2.2"

##
# Looks up the first IP address for +name+.

Expand Down
11 changes: 9 additions & 2 deletions resolv.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name = File.basename(__FILE__, ".gemspec")
version = ["lib", Array.new(name.count("-")+1).join("/")].find do |dir|
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
end rescue nil
end

Gem::Specification.new do |spec|
spec.name = "resolv"
spec.version = "0.2.2"
spec.name = name
spec.version = version
spec.authors = ["Tanaka Akira"]
spec.email = ["akr@fsij.org"]

Expand Down

0 comments on commit 6ab2385

Please sign in to comment.