wotusay 0.1.0
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 +7 -0
- data/lib/wotusay.rb +28 -0
- metadata +44 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: fb457b99f175679b3ea113168caced6575c249b1
|
|
4
|
+
data.tar.gz: cae6811e2be73a630811f4269505ba6c40b02e93
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 1a2c68b345f3805cc1129d17eb041e79e376da3f9c856dcd4f3d0a95b0d09d161e0d53adad5635dc8b7d7a04c7b3bec973afb1b62ccc1c516cb9a2530be0e8e8
|
|
7
|
+
data.tar.gz: 1e15aa719e18450578d4ce419affcc3efe2fcc8879b521054ae6249ff5c5c46024b5922ae8d69d050c6a601de7e00f6e5e6743cc5a6b28e6f572d1e58d86c38e
|
data/lib/wotusay.rb
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
def ask_valid(title)
|
|
2
|
+
value = nil
|
|
3
|
+
loop do
|
|
4
|
+
puts "Enter #{ title }:"
|
|
5
|
+
print '> '
|
|
6
|
+
input = gets.strip # Strip whitespace
|
|
7
|
+
|
|
8
|
+
begin
|
|
9
|
+
value = yield input
|
|
10
|
+
rescue => e
|
|
11
|
+
puts "Error: #{e.message}"
|
|
12
|
+
value = nil
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
break unless value.nil?
|
|
16
|
+
|
|
17
|
+
puts "* Invalid #{ title } *"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
value
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def ask_valid_string(title)
|
|
24
|
+
ask_valid(title) do |input|
|
|
25
|
+
next nil if input.empty?
|
|
26
|
+
input
|
|
27
|
+
end
|
|
28
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: wotusay
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Patrick Smith
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2016-09-28 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: User entry convenience
|
|
14
|
+
email: patrick@burntcaramel.com
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/wotusay.rb
|
|
20
|
+
homepage: https://rubygems.org/gems/wotusay
|
|
21
|
+
licenses:
|
|
22
|
+
- MIT
|
|
23
|
+
metadata: {}
|
|
24
|
+
post_install_message:
|
|
25
|
+
rdoc_options: []
|
|
26
|
+
require_paths:
|
|
27
|
+
- lib
|
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
34
|
+
requirements:
|
|
35
|
+
- - ">="
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: '0'
|
|
38
|
+
requirements: []
|
|
39
|
+
rubyforge_project:
|
|
40
|
+
rubygems_version: 2.5.1
|
|
41
|
+
signing_key:
|
|
42
|
+
specification_version: 4
|
|
43
|
+
summary: User entry convenience
|
|
44
|
+
test_files: []
|