This commit is contained in:
Petr Korolev 2014-11-10 09:21:02 +02:00
parent e75e358ef8
commit 62d9b7f4a6

View File

@ -1,7 +1,7 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require 'optparse' require 'optparse'
@options = {:dry_run => false, :major => false, :minor => false, :revision => true} @options = {:dry_run => false, :major => false, :minor => false, :patch => true}
OptionParser.new { |opts| OptionParser.new { |opts|
opts.banner = 'Usage: bump.rb [options]' opts.banner = 'Usage: bump.rb [options]'
@ -16,7 +16,7 @@ OptionParser.new { |opts|
@options[:minor] = v @options[:minor] = v
end end
opts.on('-p', '--patch', 'Bump patch version') do |v| opts.on('-p', '--patch', 'Bump patch version') do |v|
@options[:revision] = v @options[:patch] = v
end end
}.parse! }.parse!
@ -66,7 +66,7 @@ def bump_version(result_array)
bumped_result[1] += 1 bumped_result[1] += 1
bumped_result[2] = 0 bumped_result[2] = 0
else else
if @options[:revision] if @options[:patch]
bumped_result[2] += 1 bumped_result[2] += 1
end end
end end