interact 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -249,11 +249,11 @@ module Interactive
249
249
  choice_completion(x, options).start_with? ans
250
250
  }
251
251
 
252
- if matches.size == 1
253
- [true, matches.first]
254
- elsif choices and ans =~ /^\s*\d+\s*$/ and \
255
- ans.to_i - 1 >= 0 and res = choices.to_a[ans.to_i - 1]
252
+ if choices and ans =~ /^\s*\d+\s*$/ and \
253
+ ans.to_i - 1 >= 0 and res = choices.to_a[ans.to_i - 1]
256
254
  [true, res]
255
+ elsif matches.size == 1
256
+ [true, matches.first]
257
257
  elsif matches.size > 1
258
258
  matches_list = matches.collect { |m|
259
259
  show_choice(m, options)
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2011 Alex Suraci
2
2
 
3
3
  module Interact
4
- VERSION = "0.4.5"
4
+ VERSION = "0.4.6"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interact
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 5
10
- version: 0.4.5
9
+ - 6
10
+ version: 0.4.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Suraci
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-07-15 00:00:00 Z
18
+ date: 2012-07-25 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake