google-browse 0.1.2 → 0.1.3

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.
data/README.md CHANGED
@@ -35,9 +35,9 @@ Usage
35
35
  Example output
36
36
  --------------
37
37
 
38
- $ ruby bin/google-browse fish
38
+ $ google-browse fish
39
39
 
40
- Google Browse v0.1.1
40
+ Google Browse v0.1.2
41
41
 
42
42
 
43
43
  Page 1, showing results 1 to 5 for: fish
data/bin/google-browse CHANGED
@@ -10,7 +10,15 @@ require_relative '../lib/google-browse'
10
10
  # Manage CLI options.
11
11
  results_per_page = GoogleBrowse::Browser::DEFAULT_RESULTS_PER_PAGE
12
12
  opts = Slop.parse help: true do
13
- banner "Usage: #{File.basename $0} [options] ['QUERY-STRING']"
13
+ banner <<-END_OF_TEXT
14
+ Google Browse v#{GoogleBrowse::VERSION}
15
+
16
+ Usage: #{File.basename $0} [OPTIONS]
17
+
18
+ Options:
19
+ END_OF_TEXT
20
+
21
+ on 'q=', 'query=', "Initial search query"
14
22
 
15
23
  on 'n=', 'number=',
16
24
  "Number of results per page (default: #{results_per_page})",
@@ -28,13 +36,10 @@ end
28
36
 
29
37
  cli_error opts, 'Must have 1 or more results per page!' unless opts[:number] >= 1
30
38
 
31
- # BUG: No idea why the -n option STAYS in argv ;(
32
- query = ARGV.empty? ? nil : ARGV.join(" ")
33
-
34
39
  puts
35
40
  puts "Google Browse v#{GoogleBrowse::VERSION}"
36
41
 
37
- GoogleBrowse.search query: query, results_per_page: opts[:number]
42
+ GoogleBrowse.search query: opts[:query], results_per_page: opts[:number]
38
43
 
39
44
 
40
45
 
@@ -1,3 +1,3 @@
1
1
  module GoogleBrowse
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-browse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: