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 +4 -4
- data/README.md +13 -3
- data/lib/bogeyman/client.rb +4 -0
- data/lib/bogeyman/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3eb3573b548f35455e872db454306654fa473aba
|
|
4
|
+
data.tar.gz: 9515863c97ffef56339eed413baa0f0e8ccc045c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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).
|
data/lib/bogeyman/client.rb
CHANGED
data/lib/bogeyman/version.rb
CHANGED