Skip to content

Commit

Permalink
[ruby/find] Expose Find::VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt authored and matzbot committed Apr 3, 2023
1 parent 2f1586f commit a70653c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/find.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 = "find"
spec.version = "0.1.1"
spec.name = name
spec.version = version
spec.authors = ['Kazuki Tsujimoto']
spec.email = ['kazuki@callcc.net']

Expand Down
2 changes: 2 additions & 0 deletions lib/find.rb
Expand Up @@ -27,6 +27,8 @@
#
module Find

VERSION = "0.1.1"

#
# Calls the associated block with the name of every file and directory listed
# as arguments, then recursively on their subdirectories, and so on.
Expand Down

0 comments on commit a70653c

Please sign in to comment.