whatsa 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/config/environment.rb +1 -1
- data/lib/whatsa/cli.rb +3 -1
- data/lib/whatsa/section.rb +2 -2
- data/lib/whatsa/version.rb +1 -1
- data/whatsa.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1993b2561b3445bf9b58411f7febd1f450f61a0b
|
4
|
+
data.tar.gz: 213a0acf46b568f07db9d8b05990870212584bcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cb9214339408ba6b176ca9910213f6555d2f59f5934ecbc491ac2ff50ebbda735c404114a1c05273eca16d57d4753f6b69c0741826c8e9dd30e3b72293728b2
|
7
|
+
data.tar.gz: 02a43daaf63c4c110e79b3fd8947f74106f4f81832bc660efd600a62ce4eb39cd1fd6b08da07d5a80382e35b326d66fde44e8ac0c9a7dc5f8c2a32a4f1103c89
|
data/README.md
CHANGED
data/config/environment.rb
CHANGED
data/lib/whatsa/cli.rb
CHANGED
@@ -62,7 +62,8 @@ class Whatsa::CLI
|
|
62
62
|
stripped_title = dmb.title.gsub("(disambiguation)", "").strip
|
63
63
|
puts "Hmmm... #{stripped_title} could mean a few different things:\n"
|
64
64
|
dmb.descriptions.each_with_index do |kvp, i|
|
65
|
-
|
65
|
+
desc = kvp[1].empty? ? "" : " - #{kvp[1]}"
|
66
|
+
puts "#{i + 1}. #{kvp[0].to_s}" + desc
|
66
67
|
end
|
67
68
|
puts "\nPlease select a choice, either by name or number."
|
68
69
|
end
|
@@ -101,6 +102,7 @@ class Whatsa::CLI
|
|
101
102
|
|
102
103
|
def summarize(text)
|
103
104
|
system("clear")
|
105
|
+
return full(text) if text.summary == text.full_text
|
104
106
|
puts word_wrap(text.summary)
|
105
107
|
summary_helpline
|
106
108
|
input = gets_command
|
data/lib/whatsa/section.rb
CHANGED
@@ -8,11 +8,11 @@ class Whatsa::Section
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def summary
|
11
|
-
self.paragraphs.first
|
11
|
+
self.paragraphs.first || "[no displayable information]"
|
12
12
|
end
|
13
13
|
|
14
14
|
def full_text
|
15
|
-
self.paragraphs.join("\n\n")
|
15
|
+
self.paragraphs.empty? ? "[no displayable information]" : self.paragraphs.join("\n\n")
|
16
16
|
end
|
17
17
|
|
18
18
|
private
|
data/lib/whatsa/version.rb
CHANGED
data/whatsa.gemspec
CHANGED
@@ -26,5 +26,6 @@ If you're not super satisfied with that bit of information (and you need to know
|
|
26
26
|
spec.add_development_dependency "bundler", "~> 1.13"
|
27
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
28
28
|
spec.add_development_dependency "nokogiri"
|
29
|
+
spec.add_development_dependency "pry"
|
29
30
|
|
30
31
|
end
|
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.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keegan Leitz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: |-
|
56
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 (usually a surprisingly decent summary).
|
57
71
|
|