inputs 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 81bad47ccb616ef1798bea85ecb7882048293b92
4
- data.tar.gz: 69daab464e4543567b074e53eb69e1eee9b572d0
2
+ SHA256:
3
+ metadata.gz: e1ccd975b17443a60052cbd5e18170b9c716b949435c2a68b811f5d89d85f4c0
4
+ data.tar.gz: ffb3db95c043d5f3d61c5953d25bac583ee48657a390e782a9ff323f69594eef
5
5
  SHA512:
6
- metadata.gz: aa4a56cfca24fb242a03fb619ea744fc95d2759749ac9a5d4a0dcc0f52ca7c682fdfb64a0f5729386ead5ea065816ecc651a7513995470c659f3479a4dc15787
7
- data.tar.gz: 68ffcc34e1e367a0054a8f0fd19db928536066276729f4dec9a1fab363a74c8cdcdf64d84f7049cf8eb8df9617973a2994a76043b8eeca8878172203d10867af
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
@@ -1,3 +1,3 @@
1
1
  module Inputs
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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: 2017-11-06 00:00:00.000000000 Z
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
- rubyforge_project:
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