Skip to content

Commit e38b8b0

Browse files
committed
Expose Shellwords::VERSION
1 parent 4213903 commit e38b8b0

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/shellwords.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
# 1: {IEEE Std 1003.1-2008, 2016 Edition, the Shell & Utilities volume}[http://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html]
6969

7070
module Shellwords
71+
72+
VERSION = "0.1.0"
73+
7174
# Splits a string into an array of tokens in the same way the UNIX
7275
# Bourne shell does.
7376
#

shellwords.gemspec

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
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+
8+
19
Gem::Specification.new do |spec|
2-
spec.name = "shellwords"
3-
spec.version = "0.1.0"
10+
spec.name = name
11+
spec.version = version
412
spec.authors = ["Akinori MUSHA"]
513
spec.email = ["knu@idaemons.org"]
614

0 commit comments

Comments
 (0)