Skip to content

Commit 3d0e65e

Browse files
committed
Expose PP::VERSION
1 parent 8870aa0 commit 3d0e65e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/pp.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
# Tanaka Akira <akr@fsij.org>
6262

6363
class PP < PrettyPrint
64+
65+
VERSION = "0.4.0"
66+
6467
# Returns the usable width for +out+.
6568
# As the width of +out+:
6669
# 1. If +out+ is assigned to a tty device, its width is used.

pp.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 = "pp"
3-
spec.version = "0.4.0"
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)