Skip to content

Commit d39b33f

Browse files
committed
Expose Set::VERSION
1 parent 23a95b6 commit d39b33f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/set.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@
216216
# has been modified while an element in the set.
217217
#
218218
class Set
219+
220+
VERSION = "1.0.3"
221+
219222
include Enumerable
220223

221224
# Creates a new set containing the given objects.

set.gemspec

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
name = File.basename(__FILE__, ".gemspec")
2+
version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir|
3+
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
4+
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
5+
end rescue nil
6+
end
7+
18
Gem::Specification.new do |spec|
2-
spec.name = "set"
3-
spec.version = "1.0.3"
9+
spec.name = name
10+
spec.version = version
411
spec.authors = ["Akinori MUSHA"]
512
spec.email = ["knu@idaemons.org"]
613

0 commit comments

Comments
 (0)