Skip to content

Commit

Permalink
Merge pull request #30 from ruby/expose-gem-version
Browse files Browse the repository at this point in the history
Expose Pathname::VERSION
  • Loading branch information
hsbt committed Apr 14, 2023
2 parents 4c2952a + 2b0b1a8 commit 651622f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/pathname.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

class Pathname

VERSION = "0.2.1"

# :stopdoc:

# to_path is implemented so Pathname objects are usable with File.open, etc.
Expand Down
11 changes: 9 additions & 2 deletions pathname.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name = File.basename(__FILE__, ".gemspec")
version = ["lib", "ext/lib"].find do |dir|
break File.foreach(File.join(__dir__, dir, "#{name}.rb")) do |line|
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
end rescue nil
end

Gem::Specification.new do |spec|
spec.name = "pathname"
spec.version = "0.2.1"
spec.name = name
spec.version = version
spec.authors = ["Tanaka Akira"]
spec.email = ["akr@fsij.org"]

Expand Down

0 comments on commit 651622f

Please sign in to comment.