Sha256: fe29656eccd7ce82a4bdb5d542af67686ee184a536118efbca7184f79593b30a

Contents?: true

Size: 563 Bytes

Versions: 1

Compression:

Stored size: 563 Bytes

Contents

#!/usr/bin/env ruby
%w{rubygems platform}.each {|library| require library}
require "#{File.dirname(__FILE__) + '/../lib'}/mac_clipboard"

if :macosx == Platform::IMPL
  search_term = ARGV[0] || MacClipboard.read
  if search_term.empty?
    puts "Usage: google search_term_without_spaces"
    puts "       google 'search term with spaces'"
    puts "       google"
    puts "              (if invoking without command-line args, must have text in clipboard buffer)"
    exit
  end
  system("open http://google.com/search?q=#{search_term.gsub(/ |\n/, '%20')}")
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
utility_belt-1.0.0 bin/google