google_terminal 0.0.2

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.
Files changed (2) hide show
  1. data/bin/google +27 -0
  2. metadata +59 -0
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ require "rubygems"
3
+ require "thor"
4
+
5
+ OSX_CHROME_PATH = "/Applications/Google Chrome.app"
6
+
7
+ class Google < Thor
8
+ default_task :search
9
+
10
+ desc "search QUERY", "whatever"
11
+ def search(query = nil)
12
+ if query
13
+ Kernel.exec "open", OSX_CHROME_PATH, "http://www.google.com/?#sclient=psy-ab&hl=en&source=hp&q=#{query}&btnK=Google+Search"
14
+ else
15
+ Kernel.exec "open", OSX_CHROME_PATH
16
+ end
17
+ end
18
+ end
19
+
20
+ if ARGV.empty?
21
+ # Perform the default, it doesn't have to be a Thor task
22
+ Google.start
23
+ else
24
+ # Start Thor as usual
25
+ Google.new.search(ARGV.join("+"))
26
+ end
27
+
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google_terminal
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - William Estoque & Simon Le Parc
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-12-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: thor
16
+ requirement: &70218297275720 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70218297275720
25
+ description: Googles from the terminal!
26
+ email:
27
+ - william.estoque@gmail.com & lpl.simon@gmail.com
28
+ executables:
29
+ - google
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - bin/google
34
+ homepage: http://github.com/westoque/google_terminal
35
+ licenses: []
36
+ post_install_message:
37
+ rdoc_options: []
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubyforge_project: google_terminal
54
+ rubygems_version: 1.8.12
55
+ signing_key:
56
+ specification_version: 3
57
+ summary: ! '`google chocolate` will open Google Chrome with a new tab and googles
58
+ `chocolate` for you'
59
+ test_files: []