inputs 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +8 -2
- data/lib/inputs.rb +5 -0
- data/lib/inputs/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e1ccd975b17443a60052cbd5e18170b9c716b949435c2a68b811f5d89d85f4c0
|
4
|
+
data.tar.gz: ffb3db95c043d5f3d61c5953d25bac583ee48657a390e782a9ff323f69594eef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9285bf6f20bd1cc0a7a7308d554125f5d465cab06f80c42ac354671ef29b183858a02f11deffe23a1c5620a48436e1387b911c21ba5c4504bf5d1d645f8930d
|
7
|
+
data.tar.gz: 02dcfe56e072942fac7361398614af4a1ea6525205de918c54524656bb453a35e54d95c3f317edd12b7f6dd19284aaaaf8a38a905d364721c6584608af396e00
|
data/README.md
CHANGED
@@ -6,10 +6,12 @@
|
|
6
6
|
|
7
7
|
Really stupid primitive Gem that will handle some common console operations.
|
8
8
|
|
9
|
+
> Don't want to install gem ? There is a copy-paste version for your script [Inputs copy-paste version](https://gist.github.com/equivalent/5a428eb71e1f511e2a352b3865898d87)
|
10
|
+
|
11
|
+
|
9
12
|
The gem aims to be really simple. If you looking for something more complex I recommend to use
|
10
|
-
[TTY](http://piotrmurach.github.io/tty/),[tty-prompt](https://github.com/piotrmurach/tty-prompt)
|
13
|
+
[TTY](http://piotrmurach.github.io/tty/),[tty-prompt](https://github.com/piotrmurach/tty-prompt) [Reddit discussion](https://www.reddit.com/r/ruby/comments/4i5dep/gem_inputs_another_pointless_gem_for_handling/)
|
11
14
|
|
12
|
-
[Reddit discussion](https://www.reddit.com/r/ruby/comments/4i5dep/gem_inputs_another_pointless_gem_for_handling/)
|
13
15
|
|
14
16
|
```
|
15
17
|
require 'inputs'
|
@@ -26,6 +28,10 @@ Inputs.name!('Do you want to skip this question?')
|
|
26
28
|
# What is your name
|
27
29
|
# => String or Nil if no input
|
28
30
|
|
31
|
+
Inputs.password('What is the password: ')
|
32
|
+
# What is the password:
|
33
|
+
# => String
|
34
|
+
|
29
35
|
Inputs.names('Names of your parents')
|
30
36
|
# Names of your parents
|
31
37
|
# => Array
|
data/lib/inputs.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'colorize'
|
2
2
|
require "inputs/version"
|
3
|
+
require 'io/console'
|
3
4
|
|
4
5
|
module Inputs
|
5
6
|
def self.yn(question)
|
@@ -45,6 +46,10 @@ module Inputs
|
|
45
46
|
txt
|
46
47
|
end
|
47
48
|
|
49
|
+
def self.password(prompt = 'Please Enter your password: ')
|
50
|
+
IO::console.getpass(prompt)
|
51
|
+
end
|
52
|
+
|
48
53
|
def self.names(question)
|
49
54
|
output question + " (Comma separated)"
|
50
55
|
names = _input_evaluator.call
|
data/lib/inputs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inputs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Valent
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -120,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
|
124
|
-
rubygems_version: 2.6.11
|
123
|
+
rubygems_version: 3.2.17
|
125
124
|
signing_key:
|
126
125
|
specification_version: 4
|
127
126
|
summary: Pointless Gem for creating console input interfaces
|