interactive 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +6 -0
- data/README.md +3 -3
- data/lib/interactive/question.rb +4 -1
- data/lib/interactive/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc90b251376282f7c2fbab5ef3fc94ad4547ecf3
|
4
|
+
data.tar.gz: c8b1d933341201dbb9edeb0caf733b436f933ba9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c7d6275910d2e2946bd744a3a2318b548818b4c086801a1e97eba37766dd667254dc86cd498f60f8817aba8301120cb7ddaa3f72b478573fec66e554e24703f
|
7
|
+
data.tar.gz: 8d98bb7e1f87b0f8bb4d52e96f307bfe1ca57528e55046ebbeb80330c0f8bdbdb26250a5770b16b793a9a811aa47d5c37a6b8481b47550946c3a02f5c8686acf
|
data/CHANGELOG.markdown
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
v0.4.0 -- Thu Mar 19 08:32:20 EDT 2015
|
2
|
+
--------------------------------------
|
3
|
+
- added support for stubbing Question#ask RSpec's `instance_double` method.
|
4
|
+
(i.e. `instance_double("Interactive::Question", ask: nil)` does not
|
5
|
+
throw an error)
|
6
|
+
|
1
7
|
v0.3.0 -- Wed Mar 18 11:28:05 EDT 2015
|
2
8
|
--------------------------------------
|
3
9
|
- Added support for questions without options
|
data/README.md
CHANGED
@@ -28,7 +28,7 @@ If you want to ask a user a question accepting all answers:
|
|
28
28
|
|
29
29
|
```ruby
|
30
30
|
require 'interactive'
|
31
|
-
include
|
31
|
+
include Interactive
|
32
32
|
|
33
33
|
question = Question.new do |q|
|
34
34
|
q.question = "What is your api token password?"
|
@@ -67,7 +67,7 @@ If you want to ask a user a question expecting certain answers:
|
|
67
67
|
|
68
68
|
```ruby
|
69
69
|
require 'interactive'
|
70
|
-
include
|
70
|
+
include Interactive
|
71
71
|
|
72
72
|
question = Question.new do |q|
|
73
73
|
q.question = "Which item do you want to use?"
|
@@ -125,7 +125,7 @@ explanation right after asking the question:
|
|
125
125
|
|
126
126
|
```ruby
|
127
127
|
require 'interactive'
|
128
|
-
include
|
128
|
+
include Interactive
|
129
129
|
|
130
130
|
# ...
|
131
131
|
|
data/lib/interactive/question.rb
CHANGED
@@ -9,13 +9,16 @@ module Interactive
|
|
9
9
|
|
10
10
|
raise ArgumentError, "question cannot be nil nor empty." if question.nil? || question.empty?
|
11
11
|
@question_type = @options.has_hash? ? QuestionWithEagerFullExplanation.new(self) : QuestionWithLazyFullExplanation.new(self)
|
12
|
-
alias :ask :ask_and_wait_for_valid_response
|
13
12
|
end
|
14
13
|
|
15
14
|
def ask_and_wait_for_valid_response(&block)
|
16
15
|
@question_type.ask_and_wait_for_valid_response(&block)
|
17
16
|
end
|
18
17
|
|
18
|
+
def ask(&block)
|
19
|
+
ask_and_wait_for_valid_response(&block)
|
20
|
+
end
|
21
|
+
|
19
22
|
private
|
20
23
|
|
21
24
|
def response
|
data/lib/interactive/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: interactive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edderic Ugaddan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|