summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-03-30 14:08:23 +0900
committergit <svn-admin@ruby-lang.org>2023-04-25 01:58:12 +0000
commit15796ae1e80e32e8a4ff25d6663d89afc00025bb (patch)
treeb5f51e76d3457b64648206d7a784c853b2564e3b /lib
parentc301ba0a663386881addb1d987cca5e73d35cf2e (diff)
[ruby/set] Expose Set::VERSION
https://github.com/ruby/set/commit/d39b33f463
Diffstat (limited to 'lib')
-rw-r--r--lib/set.rb3
-rw-r--r--lib/set/set.gemspec11
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/set.rb b/lib/set.rb
index 95dd9217b1..cf99ffac4b 100644
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -216,6 +216,9 @@
# has been modified while an element in the set.
#
class Set
+
+ VERSION = "1.0.3"
+
include Enumerable
# Creates a new set containing the given objects.
diff --git a/lib/set/set.gemspec b/lib/set/set.gemspec
index 1e83287420..c415fac99c 100644
--- a/lib/set/set.gemspec
+++ b/lib/set/set.gemspec
@@ -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 = "set"
- spec.version = "1.0.3"
+ spec.name = name
+ spec.version = version
spec.authors = ["Akinori MUSHA"]
spec.email = ["knu@idaemons.org"]