8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
49
50
51
52
|
# File 'lib/devops_assist/version_manager.rb', line 8
def self.prompt_version(gemName, last_version = "0.1.0")
last_version = "0.1.0" if is_empty?(last_version)
pmt = TTY::Prompt.new
vers = possible_versions(last_version)
vv = []
vv << vers[2]
vv << vers[1]
vv << vers[0]
vv << "Custom"
vv << "Quit"
vsel = pmt.select(" Please select one of the versions below:") do ||
.choice "#{last_version} (current version - no change in version)", :no_change
vv.each do |v|
.choice v
end
end
case vsel
when :no_change
vsel = last_version
when "Custom"
vsel = pmt.ask(" Please provide custom version no:", required: true)
when vv[-1]
raise DevopsAssist::Error, " Aborted. Have a nice day! "
end
vsel
end
|