whatsa 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/whatsa/cli.rb +32 -13
- data/lib/whatsa/version.rb +1 -1
- data/whatsa.gemspec +7 -2
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec58e158b0487b561776deefa4ef188d098db2217c741c6334d71813b1a9b3ee
|
4
|
+
data.tar.gz: 2f98558b531ec16394e48c79cb897c11c7d0b3e626c4dfd216f3dd3481fc6155
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 306736c3618ffc71245101a6203e0b13ce55dc4aeb1e3ec3f0a55e6fa9a2b3639ec5f5cf9758f07d9dd838a02a39a622d99147cc4e9cf2e7ec4e5cc5eb299743
|
7
|
+
data.tar.gz: fcc8ef9a5852c591a2252209e2f7bf67afed6080cfb329b4b82a0b90c112f8cebd34a05581d941f1e164e8fa520e008db4065e3068168005d183e06d1bafb952
|
data/.gitignore
CHANGED
data/lib/whatsa/cli.rb
CHANGED
@@ -23,30 +23,49 @@ class Whatsa::CLI
|
|
23
23
|
puts "regarding that subject, which you can choose by number or name."
|
24
24
|
puts "You can type 'exit' to close the program (or 'help' to receive"
|
25
25
|
puts "these instructions again) at any time!"
|
26
|
+
puts ""
|
26
27
|
end
|
27
28
|
|
28
29
|
def ask
|
29
30
|
puts "What would you like to know about?"
|
30
|
-
gets_command
|
31
|
+
gets_command(true)
|
31
32
|
end
|
32
33
|
|
33
|
-
def gets_command
|
34
|
-
|
34
|
+
def gets_command(treat_as_query = false)
|
35
|
+
command_type = {
|
36
|
+
"exit" => "exit",
|
37
|
+
"quit" => "exit",
|
38
|
+
"q" => "exit",
|
39
|
+
|
40
|
+
"help" => "help",
|
41
|
+
"h" => "help",
|
42
|
+
"instructions": ("help" unless treat_as_query),
|
43
|
+
|
44
|
+
"new" => "new",
|
45
|
+
"different" => ("new" unless treat_as_query),
|
46
|
+
"something else" => ("new" unless treat_as_query),
|
47
|
+
"again" => ("new" unless treat_as_query),
|
48
|
+
|
49
|
+
"other" => ("other" unless treat_as_query),
|
50
|
+
"categories" => ("other" unless treat_as_query),
|
51
|
+
"category" => ("other" unless treat_as_query),
|
52
|
+
"dig" => ("other" unless treat_as_query),
|
53
|
+
|
54
|
+
"" => "blank"
|
55
|
+
}
|
56
|
+
|
35
57
|
loop do
|
36
58
|
print "> "
|
37
59
|
input = gets.strip.downcase
|
38
|
-
case input
|
39
|
-
when "exit"
|
40
|
-
|
41
|
-
when "
|
42
|
-
|
43
|
-
when "
|
44
|
-
|
45
|
-
else
|
46
|
-
break
|
60
|
+
case command_type[input]
|
61
|
+
when "exit" then exit
|
62
|
+
when "help" then instructions
|
63
|
+
when "new" then return run
|
64
|
+
when "other" then return "other"
|
65
|
+
when "" then next
|
66
|
+
else return input
|
47
67
|
end
|
48
68
|
end
|
49
|
-
input
|
50
69
|
end
|
51
70
|
|
52
71
|
def display_dmb(dmb)
|
data/lib/whatsa/version.rb
CHANGED
data/whatsa.gemspec
CHANGED
@@ -10,9 +10,14 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["kjleitz@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{What is that? Okay, okay, I don't need a lecture... just gimme the short 'n sweet!}
|
13
|
-
spec.description =
|
13
|
+
spec.description = <<~SPECDESC
|
14
|
+
Whatsa harnesses the POWER OF WIKIPEDIA, allowing you to quickly search a
|
15
|
+
word or phrase and receive a short (one paragraph) summary about that subject,
|
16
|
+
right from the command line! Type 'more' to get a longer summary, 'other' to
|
17
|
+
pick a specific category about that subject, and more. If you're too vague,
|
18
|
+
Whatsa allows you to select from a disambiguation of topics.
|
19
|
+
SPECDESC
|
14
20
|
|
15
|
-
If you're not super satisfied with that bit of information (and you need to know a little more) you can type `more` to get a better picture of that subject. If you're _still_ not satisfied, and you want to know something _specific_ about the thing you've searched, type `other`, and it will list the categories of information Wikipedia knows about the subject (its "History", "Early Life", "Uses", etc.). You can select one of those sections, if you'd like, and it will give you the first paragraph of that section, too (which you can extend similarly with another `more` command). You can make a new query with `new`, ask for help at any time with `help`, or exit the application with `exit`.}
|
16
21
|
spec.homepage = "https://github.com/kjleitz/whatsa"
|
17
22
|
spec.license = "MIT"
|
18
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whatsa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keegan Leitz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -66,10 +66,12 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description:
|
70
|
-
Whatsa
|
71
|
-
|
72
|
-
|
69
|
+
description: |
|
70
|
+
Whatsa harnesses the POWER OF WIKIPEDIA, allowing you to quickly search a
|
71
|
+
word or phrase and receive a short (one paragraph) summary about that subject,
|
72
|
+
right from the command line! Type 'more' to get a longer summary, 'other' to
|
73
|
+
pick a specific category about that subject, and more. If you're too vague,
|
74
|
+
Whatsa allows you to select from a disambiguation of topics.
|
73
75
|
email:
|
74
76
|
- kjleitz@gmail.com
|
75
77
|
executables:
|