Skip to content

Commit 14f442a

Browse files
hsbtmatzbot
authored andcommitted
[ruby/base64] Expose Base64::VERSION
ruby/base64@dda85a0839
1 parent ba4f01f commit 14f442a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/base64.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 = "base64"
3-
spec.version = "0.1.1"
9+
spec.name = name
10+
spec.version = version
411
spec.authors = ["Yusuke Endoh"]
512
spec.email = ["mame@ruby-lang.org"]
613

lib/base64.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
# binary data into purely printable characters.
2323

2424
module Base64
25+
26+
VERSION = "0.1.1"
27+
2528
module_function
2629

2730
# Returns the Base64-encoded version of +bin+.

0 commit comments

Comments
 (0)