prompt 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/guess.rb +12 -0
- data/lib/prompt/parameter.rb +1 -1
- data/lib/prompt/prompt_module.rb +1 -1
- data/spec/prompt/command_spec.rb +8 -0
- metadata +4 -3
data/examples/guess.rb
ADDED
data/lib/prompt/parameter.rb
CHANGED
data/lib/prompt/prompt_module.rb
CHANGED
data/spec/prompt/command_spec.rb
CHANGED
@@ -161,6 +161,14 @@ describe Prompt::Command do
|
|
161
161
|
c.completions(1, "v").should == ['very fast']
|
162
162
|
end
|
163
163
|
|
164
|
+
it "expand correctly if parameter values are not strings" do
|
165
|
+
nums = Parameter.new(:numbers, "", [1, 2, 3, 10])
|
166
|
+
c = Command.new(["guess", matcher(nums)])
|
167
|
+
c.completions(1, "1").should == ["1", "10"]
|
168
|
+
c.completions(1, "2").should == ["2"]
|
169
|
+
c.completions(1, "9").should == []
|
170
|
+
end
|
171
|
+
|
164
172
|
it "expands correctly when *param is followed by :param" do
|
165
173
|
speed = Parameter.new(:speed, "", SPEEDS)
|
166
174
|
dir = Parameter.new(:dir, "", DIRECTIONS)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prompt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Prompt makes it easy to build slick command-line applications with tab
|
15
15
|
completion, command history, and built-in help
|
@@ -40,6 +40,7 @@ files:
|
|
40
40
|
- spec/prompt/console_spec.rb
|
41
41
|
- spec/spec_helper.rb
|
42
42
|
- examples/file_manager
|
43
|
+
- examples/guess.rb
|
43
44
|
- examples/mud
|
44
45
|
homepage: http://github.com/mudynamics/prompt
|
45
46
|
licenses: []
|
@@ -61,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
62
|
version: '0'
|
62
63
|
requirements: []
|
63
64
|
rubyforge_project:
|
64
|
-
rubygems_version: 1.8.
|
65
|
+
rubygems_version: 1.8.23
|
65
66
|
signing_key:
|
66
67
|
specification_version: 3
|
67
68
|
summary: A micro framework that makes it easy to build slick command-line applications
|