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.
@@ -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
@@ -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
Binary file
Binary file
Binary file
Binary file
Binary file