goog 0.2.2 → 0.2.3

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 +7 -5
  2. data/lib/goog.rb +1 -1
  3. metadata +1 -1
data/bin/goog CHANGED
@@ -158,13 +158,15 @@ if options[:less]
158
158
  $stdout = STDOUT
159
159
  loop {
160
160
  puts File.read($tempfile.path)
161
- print "Show result number: "
162
- n = STDIN.gets
163
- if n !~ /\d/
161
+ print "Show result number (may add pipe or redirect after, like `> file.txt`. `| less` is default): "
162
+ s = STDIN.gets
163
+ if s !~ /\d/
164
164
  exit
165
165
  end
166
- n = n.to_i
167
- system "elinks -dump -no-numbering '#{links[n - 1]}' | less"
166
+ n = s[/\d+/,0].to_i
167
+ pipe = s[/[|>].*$/,0] || '| less'
168
+ cmd = "elinks -dump -no-numbering '#{links[n - 1]}' #{pipe}"
169
+ system cmd
168
170
  }
169
171
  end
170
172
 
data/lib/goog.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Goog
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
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.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: