google 1.0.6 → 1.0.7
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.
- data/google.gemspec +1 -1
- data/lib/google.rb +8 -3
- data/lib/google/input.rb +7 -2
- metadata +1 -1
data/google.gemspec
CHANGED
data/lib/google.rb
CHANGED
@@ -8,7 +8,7 @@ require_relative 'google/grab'
|
|
8
8
|
require_relative 'google/pipe-view'
|
9
9
|
|
10
10
|
opts = Trollop::options do
|
11
|
-
version "google v1.0.
|
11
|
+
version "google v1.0.7 (c) 2012 Kerrick Long http://kerrick.github.com/google"
|
12
12
|
banner <<-EOM
|
13
13
|
The google gem is a simple tool to search Gooogle with via a CLI.
|
14
14
|
Usage:
|
@@ -57,5 +57,10 @@ if !opts[:readability] && opts[:markdown]
|
|
57
57
|
raise Trollop::die "Must use --no-markdown if you use --no-readability"
|
58
58
|
end
|
59
59
|
|
60
|
-
|
61
|
-
g.
|
60
|
+
begin
|
61
|
+
g = Google.new query, opts
|
62
|
+
g.search
|
63
|
+
rescue Interrupt
|
64
|
+
puts "\nInterrupt received. Exiting application."
|
65
|
+
exit
|
66
|
+
end
|
data/lib/google/input.rb
CHANGED
@@ -9,7 +9,12 @@ class Google
|
|
9
9
|
Formatador.display Utils::wrap(prompt)
|
10
10
|
|
11
11
|
Formatador.display "\n[bold]>[/] "
|
12
|
-
choice = STDIN.gets
|
12
|
+
choice = STDIN.gets
|
13
|
+
if choice.nil?
|
14
|
+
choice = ' '
|
15
|
+
else
|
16
|
+
choice.chomp + ' '
|
17
|
+
end
|
13
18
|
|
14
19
|
case
|
15
20
|
when choice[0].downcase == 'e' || choice[0].downcase == 'q'
|
@@ -46,7 +51,7 @@ class Google
|
|
46
51
|
end
|
47
52
|
end
|
48
53
|
else
|
49
|
-
input info
|
54
|
+
input info, result_array
|
50
55
|
end
|
51
56
|
end
|
52
57
|
end
|