inquirer.rb 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inquirer.rb +3 -1
- data/lib/inquirer/prompts/checkbox.rb +1 -5
- data/lib/inquirer/prompts/checkbox_filterable.rb +255 -0
- data/lib/inquirer/prompts/confirm.rb +11 -9
- data/lib/inquirer/prompts/list_filterable.rb +209 -0
- data/lib/inquirer/style.rb +8 -10
- data/lib/inquirer/style/checkbox_filterable.rb +14 -0
- data/lib/inquirer/style/list.rb +1 -1
- data/lib/inquirer/style/list_filterable.rb +14 -0
- data/lib/inquirer/utils/iochar.rb +5 -1
- data/lib/inquirer/utils/iohelper.rb +22 -12
- data/lib/inquirer/version.rb +1 -1
- metadata +30 -30
- data/.gitignore +0 -9
- data/CODE_OF_CONDUCT.md +0 -49
- data/Gemfile +0 -4
- data/LICENSE.txt +0 -21
- data/README.md +0 -203
- data/Rakefile +0 -2
- data/examples/checkbox.rb +0 -211
- data/examples/confirm.rb +0 -63
- data/examples/input.rb +0 -67
- data/examples/list.rb +0 -193
- data/examples/password.rb +0 -63
- data/inquirer.gemspec +0 -34
- data/screenshots/checkbox.png +0 -0
- data/screenshots/confirm.png +0 -0
- data/screenshots/input.png +0 -0
- data/screenshots/list.png +0 -0
- data/screenshots/password.png +0 -0
data/examples/password.rb
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
lib = File.expand_path('../../lib/', __FILE__)
|
2
|
-
$:.unshift lib unless $:.include?(lib)
|
3
|
-
|
4
|
-
require 'inquirer'
|
5
|
-
|
6
|
-
questions = [
|
7
|
-
{
|
8
|
-
name: :password,
|
9
|
-
type: :password,
|
10
|
-
message: 'What should be your password?',
|
11
|
-
},
|
12
|
-
{
|
13
|
-
name: :password_default,
|
14
|
-
type: :password,
|
15
|
-
message: 'What should be your password?',
|
16
|
-
default: 'Password',
|
17
|
-
},
|
18
|
-
{
|
19
|
-
name: :password_never,
|
20
|
-
type: :password,
|
21
|
-
message: 'What should be your password?',
|
22
|
-
when: false,
|
23
|
-
},
|
24
|
-
{
|
25
|
-
name: :password_never_lambda,
|
26
|
-
type: :password,
|
27
|
-
message: 'What should be your password?',
|
28
|
-
when: lambda { |answers| true },
|
29
|
-
},
|
30
|
-
{
|
31
|
-
name: :password_default_password,
|
32
|
-
type: :password,
|
33
|
-
message: 'What should be your password?',
|
34
|
-
when: lambda { |answers| answers[:password_default] == 'Password' },
|
35
|
-
},
|
36
|
-
{
|
37
|
-
name: :password_validate_password,
|
38
|
-
type: :password,
|
39
|
-
message: 'What should be your password?',
|
40
|
-
validate: lambda { |answer| answer == 'Password' },
|
41
|
-
},
|
42
|
-
{
|
43
|
-
name: :password_validate_password_message,
|
44
|
-
type: :password,
|
45
|
-
message: 'What should be your password?',
|
46
|
-
validate: lambda { |answer|
|
47
|
-
return true if answer == 'Password'
|
48
|
-
'Only Password!'
|
49
|
-
},
|
50
|
-
},
|
51
|
-
{
|
52
|
-
name: :password_filter_password,
|
53
|
-
type: :password,
|
54
|
-
message: 'What should be your password?',
|
55
|
-
filter: lambda { |answer|
|
56
|
-
'Password'
|
57
|
-
},
|
58
|
-
},
|
59
|
-
]
|
60
|
-
|
61
|
-
answers = Inquirer.prompt(questions)
|
62
|
-
|
63
|
-
p answers
|
data/inquirer.gemspec
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'inquirer/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'inquirer.rb'
|
8
|
-
spec.version = Inquirer::VERSION
|
9
|
-
spec.authors = ['Thorsten Eckel']
|
10
|
-
spec.email = ['te@znuny.com']
|
11
|
-
|
12
|
-
spec.summary = 'A collection of common interactive command line user interfaces.'
|
13
|
-
spec.description = 'A collection of common interactive command line user interfaces. A (not yet compleded) clone of the great Inquirer.js (https://github.com/SBoudrias/Inquirer.js) and strongly inspired by the similar inquirer.rb (https://github.com/arlimus/inquirer.rb).'
|
14
|
-
spec.homepage = 'https://github.com/thorsteneckel/inquirer'
|
15
|
-
spec.license = 'MIT'
|
16
|
-
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
spec.require_paths = ['lib']
|
19
|
-
|
20
|
-
spec.add_development_dependency 'bundler', '~> 1.11'
|
21
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
22
|
-
|
23
|
-
if( RUBY_VERSION.start_with? '1.' )
|
24
|
-
spec.add_dependency 'term-ansicolor', '~> 1.2.2'
|
25
|
-
else
|
26
|
-
spec.add_dependency 'term-ansicolor', '>= 1.3'
|
27
|
-
end
|
28
|
-
|
29
|
-
if( RUBY_ENGINE == 'rbx' )
|
30
|
-
spec.add_dependency 'rubysl-mutex_m'
|
31
|
-
spec.add_dependency 'rubysl-singleton'
|
32
|
-
spec.add_dependency 'rubysl-io-console'
|
33
|
-
end
|
34
|
-
end
|
data/screenshots/checkbox.png
DELETED
Binary file
|
data/screenshots/confirm.png
DELETED
Binary file
|
data/screenshots/input.png
DELETED
Binary file
|
data/screenshots/list.png
DELETED
Binary file
|
data/screenshots/password.png
DELETED
Binary file
|