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.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "google"
3
- s.version = "1.0.6"
3
+ s.version = "1.0.7"
4
4
  s.executables << 'google'
5
5
  s.add_runtime_dependency "json", ["~> 1"]
6
6
  s.add_runtime_dependency "htmlentities", ["~> 4"]
@@ -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.6 (c) 2012 Kerrick Long http://kerrick.github.com/google"
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
- g = Google.new query, opts
61
- g.search
60
+ begin
61
+ g = Google.new query, opts
62
+ g.search
63
+ rescue Interrupt
64
+ puts "\nInterrupt received. Exiting application."
65
+ exit
66
+ end
@@ -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.chomp + ' '
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: