Skip to content

Commit 09f2275

Browse files
committed
Expose TSort::VERSION
1 parent dd71002 commit 09f2275

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/tsort.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@
122122
#
123123

124124
module TSort
125+
126+
VERSION = "0.1.1"
127+
125128
class Cyclic < StandardError
126129
end
127130

tsort.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 = "tsort"
3-
spec.version = "0.1.1"
9+
spec.name = name
10+
spec.version = version
411
spec.authors = ["Tanaka Akira"]
512
spec.email = ["akr@fsij.org"]
613

0 commit comments

Comments
 (0)