Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/optparse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@
#
class OptionParser
# The version string
OptionParser::Version = "0.7.0.dev.2"
VERSION = "0.7.0.dev.2"
Version = VERSION # for compatibility

# :stopdoc:
NoArgument = [NO_ARGUMENT = :NONE, nil].freeze
Expand Down
2 changes: 1 addition & 1 deletion optparse.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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*OptionParser::Version\s*=\s*"(.*)"/ =~ line and break $1
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
end rescue nil
end

Expand Down
2 changes: 1 addition & 1 deletion rakelib/version.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class << (helper = Bundler::GemHelper.instance)
def update_version
File.open(mainfile, "r+b") do |f|
d = f.read
if d.sub!(/^(\s*OptionParser::Version\s*=\s*)".*"/) {$1 + gemspec.version.to_s.dump}
if d.sub!(/^(\s*VERSION\s*=\s*)".*"/) {$1 + gemspec.version.to_s.dump}
f.rewind
f.truncate(0)
f.print(d)
Expand Down