22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/bump.rb', line 22
def self.run(bump, options={})
options = defaults.merge(options)
case bump
when *BUMPS
bump_part(bump, options)
when "set"
raise InvalidVersionError unless options[:version]
bump_set(options[:version], options)
when "current"
["Current version: #{current}", 0]
else
raise InvalidOptionError
end
rescue InvalidOptionError
["Invalid option. Choose between #{OPTIONS.join(',')}.", 1]
rescue InvalidVersionError
["Invalid version number given.", 1]
rescue UnfoundVersionError
["Unable to find your gem version", 1]
rescue UnfoundVersionFileError
["Unable to find a file with the gem version", 1]
rescue TooManyVersionFilesError
["More than one gemspec file", 1]
rescue Exception => e
["Something wrong happened: #{e.message}\n#{e.backtrace.join("\n")}", 1]
end
|