Skip to content

Commit

Permalink
[ruby/pp] Expose PP::VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt authored and matzbot committed Apr 14, 2023
1 parent 652f273 commit 3f87564
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/pp.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 = "pp"
spec.version = "0.4.0"
spec.name = name
spec.version = version
spec.authors = ["Tanaka Akira"]
spec.email = ["akr@fsij.org"]

Expand Down
3 changes: 3 additions & 0 deletions lib/pp.rb
Expand Up @@ -61,6 +61,9 @@
# Tanaka Akira <akr@fsij.org>

class PP < PrettyPrint

VERSION = "0.4.0"

# Returns the usable width for +out+.
# As the width of +out+:
# 1. If +out+ is assigned to a tty device, its width is used.
Expand Down

0 comments on commit 3f87564

Please sign in to comment.