goog 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/goog +5 -5
  2. data/lib/goog.rb +1 -1
  3. metadata +1 -1
data/bin/goog CHANGED
@@ -54,9 +54,9 @@ END
54
54
  opts.on("-c", '--color', 'Force color output') {options[:color] = true}
55
55
  opts.on("-x", '--expand', 'Expand all results into web page text') { options[:expand] = true }
56
56
  opts.on("-e", '--elinks', 'Open results in elinks') { options[:elinks] = true }
57
- opts.on("-l", '--less', 'Open results in less') { options[:less] = true }
57
+ opts.on("-i", '--interactive', 'Prompt for selection') { options[:interactive] = true }
58
58
  opts.on("-v", '--vim', 'Open results in Vim and bind <leader>o to open URL on or after cursor') { options[:vim] = true }
59
- opts.on("-i", '--install-plugin', 'Install Goog as a Vim plugin') {
59
+ opts.on('--install-plugin', 'Install Goog as a Vim plugin') {
60
60
  puts "Installing goog.vim into your ~/.vim/plugin directory."
61
61
  `cp #{$vimscript_file} #{ENV['HOME']}/.vim/plugin/`
62
62
  puts "Done. Type goog -h for Vim commands."
@@ -73,7 +73,7 @@ END
73
73
  }
74
74
  end.parse!
75
75
 
76
- if options[:elinks] || options[:vim] || options[:less]
76
+ if options[:elinks] || options[:vim] || options[:interactive]
77
77
  require 'tempfile'
78
78
  $tempfile = Tempfile.new('goog')
79
79
  $stdout = $tempfile
@@ -125,7 +125,7 @@ links = []
125
125
  number = (page - 1) * 10 + (index + 1)
126
126
  res = if options[:elinks]
127
127
  %Q| <p>#{number}. <strong>#{title}</strong><br/>#{excerpt}<br/><a href='#{link}'>#{link}</a></p> |
128
- elsif !options[:vim] && (STDOUT.tty? || options[:less] || options[:color])
128
+ elsif !options[:vim] && (STDOUT.tty? || options[:interactive] || options[:color])
129
129
  ["#{number}. \e[36m#{title}\e[0m", excerpt, "\e[35m#{link }\e[0m"].compact
130
130
  else
131
131
  ["#{number}. #{title}", excerpt, link].compact
@@ -153,7 +153,7 @@ if options[:vim]
153
153
  exec "vim -S #$vimscript_file -c 'call g:Goog_set_up_search_results_buffer()' #{$tempfile.path}"
154
154
  end
155
155
 
156
- if options[:less]
156
+ if options[:interactive]
157
157
  $stdout.close
158
158
  $stdout = STDOUT
159
159
  loop {
data/lib/goog.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Goog
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: