bogeyman 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bff9a7830cb9fc3ad88c596cb54bb5f22434dc8e
4
- data.tar.gz: 6a55a355058559ac8576fd6e873abd0c4f853281
3
+ metadata.gz: 3eb3573b548f35455e872db454306654fa473aba
4
+ data.tar.gz: 9515863c97ffef56339eed413baa0f0e8ccc045c
5
5
  SHA512:
6
- metadata.gz: 83a6120e24a6e4bd3dc5d12f4c7d8da87c97bfd6db0e6dd1887a4a01049f6f2b408ac9a4f7ed71425acee45a2e6ac1e608c04c75c1ab6eeb4c8bc2e88a5efc44
7
- data.tar.gz: c4d33b84c53ab95e304f45ee1e27eda899725bd1622d90beda6c9634ccca252107412ef1ebe89e43714129f8612dcd1c2c35ea43fca907d0eed623e3e9dd329a
6
+ metadata.gz: 9cc81384f367ded293f087b435fb4f0e6c7950da18cbb37f0e75ecd58be12c7a7ad3914ded4e617f4bed458f53505a46af9d793700c332f017443f70a757209f
7
+ data.tar.gz: 395eeb82f9302da4f08ed41fb87c4486826c1ea30e6a5847a916f5271220e423e728a4839ec4327fbdac35932ec13e67e5ea7162c7ed9342086a2a2a84d059c5
data/README.md CHANGED
@@ -16,7 +16,7 @@ gem install bogeyman
16
16
  Or you can put it in your Gemfile
17
17
 
18
18
  ```ruby
19
- gem 'bogeyman', '~> 0.0.5'
19
+ gem 'bogeyman', '~> 0.0.6'
20
20
  ```
21
21
 
22
22
  ## Usage
@@ -37,8 +37,12 @@ So when your server is set up then you can do
37
37
  require 'bogeyman'
38
38
 
39
39
  client = Bogeyman::Client.new
40
- client.post 'http://example.com', param1: 'abc'
41
- client.get 'http://example.com'
40
+ response = client.post 'http://example.com', param1: 'abc'
41
+ response = client.get 'http://example.com'
42
+
43
+ p response.code
44
+ p response.body # whole html as string
45
+ p response.html # Nokogiri instance of body
42
46
  ```
43
47
 
44
48
  Or if you want to use existing cookies
@@ -77,6 +81,12 @@ client = Bogeyman::Client.new(
77
81
  )
78
82
  ```
79
83
 
84
+ You can also set proxy explicitly by set_proxy method
85
+
86
+ ```ruby
87
+ client.set_proxy 'localhost', 31313
88
+ ```
89
+
80
90
  For more information you can take a look at
81
91
  [Bogeyman.js](https://github.com/reneklacan/bogeyman.js) or [PhantomJS
82
92
  API Reference](https://github.com/ariya/phantomjs/wiki/API-Reference).
@@ -16,6 +16,10 @@ module Bogeyman
16
16
  end
17
17
  end
18
18
 
19
+ def set_proxy host, port=nil
20
+ @params[:proxy] = port ? "#{host}:#{port}" : host
21
+ end
22
+
19
23
  protected
20
24
 
21
25
  def request method, url, data
@@ -1,3 +1,3 @@
1
1
  module Bogeyman
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bogeyman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rene Klacan