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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9790a127723affb42f57cc98c69b02c3bad30751989b5aff659ea5487a1c3f8
4
- data.tar.gz: 9419777a390a934533a4e42edbfec071a492d1735444165103592cb6b71c4351
3
+ metadata.gz: ec58e158b0487b561776deefa4ef188d098db2217c741c6334d71813b1a9b3ee
4
+ data.tar.gz: 2f98558b531ec16394e48c79cb897c11c7d0b3e626c4dfd216f3dd3481fc6155
5
5
  SHA512:
6
- metadata.gz: 528671031a44ecdbf374497c1197e179dab514ab18b306690a605ba84a7aec8d7f367a300a7274d174c12b72c701374d946358ee1e00a1183d39dcb1d3fbb7a1
7
- data.tar.gz: 5beb1d7b909b91a13b52ab11af80ae3606f73eb9d55932149cb67d61c3e200ee5edbef5295e1b8d9bcccc386799dce0c090e0edbfafcc3dacd831dd5b943ee0b
6
+ metadata.gz: 306736c3618ffc71245101a6203e0b13ce55dc4aeb1e3ec3f0a55e6fa9a2b3639ec5f5cf9758f07d9dd838a02a39a622d99147cc4e9cf2e7ec4e5cc5eb299743
7
+ data.tar.gz: fcc8ef9a5852c591a2252209e2f7bf67afed6080cfb329b4b82a0b90c112f8cebd34a05581d941f1e164e8fa520e008db4065e3068168005d183e06d1bafb952
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ whatsa*.gem
@@ -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
- input = nil
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
- exit
41
- when "help"
42
- instructions
43
- when "new"
44
- run
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)
@@ -1,3 +1,3 @@
1
1
  module Whatsa
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -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 = %q{Whatsa is a CLI app that allows you to search a word or phrase and receive a quick summary about that subject. It searches your query on Wikipedia and finds the page you're most likely looking for. If you've been somewhat vague, or your search term could refer to multiple things, it will ask you to select from a disambiguation of topics. Usually, however, your term will go straight to an article. Whatsa then gives you the first paragraph of that article (often a surprisingly decent summary).
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.0
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-06 00:00:00.000000000 Z
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 is a CLI app that allows you to search a word or phrase and receive a quick summary about that subject. It searches your query on Wikipedia and finds the page you're most likely looking for. If you've been somewhat vague, or your search term could refer to multiple things, it will ask you to select from a disambiguation of topics. Usually, however, your term will go straight to an article. Whatsa then gives you the first paragraph of that article (often a surprisingly decent summary).
71
-
72
- 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`.
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: