pi 0.1.29 → 0.1.30
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/lib/cli/choose_helper.rb +4 -0
- data/lib/cli/commands/dns.rb +6 -4
- data/lib/cli/commands/projects.rb +2 -0
- data/lib/cli/interact_helper.rb +12 -6
- data/lib/cli/version.rb +1 -1
- metadata +8 -8
data/README
CHANGED
data/lib/cli/choose_helper.rb
CHANGED
data/lib/cli/commands/dns.rb
CHANGED
@@ -281,18 +281,20 @@ module PI::Cli::Command
|
|
281
281
|
targets = client.usable_dns_target(dnsid)
|
282
282
|
targets.each do |t|
|
283
283
|
t[:records].each do |v|
|
284
|
-
|
285
|
-
record_info.push({ :id => v[:id],:targetName => t[:targetName],:view => v[:view]}) if not t[:records].empty?
|
286
|
-
i = i + 1
|
284
|
+
record_info.push({ :id => v[:id],:targetName => t[:targetName],:view => v[:view]})
|
287
285
|
end
|
288
286
|
end
|
289
|
-
|
287
|
+
if record_info.empty?
|
288
|
+
err"No dns record"
|
289
|
+
else
|
290
|
+
record_info_table = table do |t|
|
290
291
|
t.headings = 'Record ID', 'Target Name', 'View Name'
|
291
292
|
record_info.each do |s|
|
292
293
|
t << [s[:id],s[:targetName], s[:view]]
|
293
294
|
end
|
294
295
|
end
|
295
296
|
display record_info_table
|
297
|
+
end
|
296
298
|
end
|
297
299
|
|
298
300
|
private
|
@@ -189,6 +189,7 @@ module PI::Cli::Command
|
|
189
189
|
end
|
190
190
|
|
191
191
|
if version
|
192
|
+
err "Invalid version name length. The max length of name is 30" unless check_version_name_valid?(version)
|
192
193
|
tmp = client.project_binary_existed(projectid, version)
|
193
194
|
err "Version '#{version}' already exists." if tmp.include?("true")
|
194
195
|
end
|
@@ -209,6 +210,7 @@ module PI::Cli::Command
|
|
209
210
|
unless version
|
210
211
|
loop{
|
211
212
|
version = ask "Please enter the version"
|
213
|
+
err "Invalid version name length. The max length of version name is 30" unless check_version_name_valid?(version)
|
212
214
|
tmp = client.project_binary_existed(projectid, version)
|
213
215
|
if tmp.include?("true")
|
214
216
|
display "Version '#{version}' already exists."
|
data/lib/cli/interact_helper.rb
CHANGED
@@ -130,7 +130,7 @@ module PI::Cli
|
|
130
130
|
|
131
131
|
while true
|
132
132
|
prompt(question, options)
|
133
|
-
ok, res =
|
133
|
+
ok, res = multi_answered(read_line(options), options)
|
134
134
|
return res if ok
|
135
135
|
end
|
136
136
|
end
|
@@ -191,7 +191,7 @@ module PI::Cli
|
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
194
|
-
def
|
194
|
+
def multi_answered(ans, options)
|
195
195
|
print "\n"
|
196
196
|
|
197
197
|
if ans.empty?
|
@@ -231,10 +231,16 @@ module PI::Cli
|
|
231
231
|
matches_list = matches.collect { |m|
|
232
232
|
show_choice(m, options)
|
233
233
|
}.join " or "
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
234
|
+
matches = matches.collect { |m|
|
235
|
+
show_choice(m, options)
|
236
|
+
}
|
237
|
+
if matches.include?(ans)
|
238
|
+
[true, ans]
|
239
|
+
else
|
240
|
+
puts "Please disambiguate: #{matches_list}?"
|
241
|
+
[false, nil]
|
242
|
+
end
|
243
|
+
|
238
244
|
else
|
239
245
|
puts "Unknown answer, please try again!"
|
240
246
|
[false, nil]
|
data/lib/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 39
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 30
|
10
|
+
version: 0.1.30
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Samsung
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-09-
|
18
|
+
date: 2012-09-14 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: json_pure
|
@@ -55,14 +55,14 @@ dependencies:
|
|
55
55
|
requirement: &id003 !ruby/object:Gem::Requirement
|
56
56
|
none: false
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
hash:
|
60
|
+
hash: 1
|
61
61
|
segments:
|
62
62
|
- 0
|
63
63
|
- 4
|
64
|
-
-
|
65
|
-
version: 0.4.
|
64
|
+
- 7
|
65
|
+
version: 0.4.7
|
66
66
|
type: :runtime
|
67
67
|
version_requirements: *id003
|
68
68
|
- !ruby/object:Gem::Dependency
|