browshot 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.rdoc +6 -0
- data/Rakefile +0 -0
- data/VERSION +1 -1
- data/lib/browshot.rb +1 -1
- data/test/test_browshot.rb +13 -10
- metadata +15 -15
data/Gemfile
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.rdoc
CHANGED
@@ -8,6 +8,8 @@ The library version matches closely the API version it handles: browshot 1.0.0 i
|
|
8
8
|
|
9
9
|
browshot can handle most the API updates within the same major version, e.g. browshot 1.0.0 should be compatible with the API 1.1 or 1.2.
|
10
10
|
|
11
|
+
Browshot gem is availabe at rubygems: https://rubygems.org/gems/browshot
|
12
|
+
|
11
13
|
== Build and install browshot
|
12
14
|
|
13
15
|
git clone https://github.com/juliensobrier/browshot-ruby
|
@@ -15,6 +17,10 @@ browshot can handle most the API updates within the same major version, e.g. bro
|
|
15
17
|
rake test
|
16
18
|
rake install
|
17
19
|
|
20
|
+
Or
|
21
|
+
|
22
|
+
gem install browshot
|
23
|
+
|
18
24
|
== Contributing to browshot
|
19
25
|
|
20
26
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
data/Rakefile
CHANGED
File without changes
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.0
|
data/lib/browshot.rb
CHANGED
@@ -34,7 +34,7 @@ class Browshot
|
|
34
34
|
|
35
35
|
# Return the API version handled by the library. Note that this library can usually handle new arguments in requests without requiring an update.
|
36
36
|
def api_version()
|
37
|
-
return "1.
|
37
|
+
return "1.3"
|
38
38
|
end
|
39
39
|
|
40
40
|
# Return the list of instances. See http://browshot.com/api/documentation#instance_list for the response format.
|
data/test/test_browshot.rb
CHANGED
@@ -14,7 +14,7 @@ class TestBrowshot < Test::Unit::TestCase
|
|
14
14
|
end
|
15
15
|
|
16
16
|
should "get the API version" do
|
17
|
-
assert_equal '1.
|
17
|
+
assert_equal '1.3', @browshot.api_version()
|
18
18
|
end
|
19
19
|
|
20
20
|
should "get the list of instances available" do
|
@@ -128,7 +128,7 @@ class TestBrowshot < Test::Unit::TestCase
|
|
128
128
|
|
129
129
|
should "create a browser" do
|
130
130
|
# browser is not actually created for test account, so the reply may not match our parameters
|
131
|
-
browser = @browshot.browser_create({'mobile' => 1, 'flash' => 1, 'user_agent' => 'test'})
|
131
|
+
browser = @browshot.browser_create({'mobile' => 1, 'flash' => 1, 'user_agent' => 'test'})
|
132
132
|
|
133
133
|
assert_equal false, browser['name'].nil?, "Browser name should be present"
|
134
134
|
assert_equal false, browser['user_agent'].nil?, "Browser user_agent should be present"
|
@@ -144,7 +144,7 @@ class TestBrowshot < Test::Unit::TestCase
|
|
144
144
|
end
|
145
145
|
|
146
146
|
should "fail to create screenshot" do
|
147
|
-
screenshot = @browshot.screenshot_create()
|
147
|
+
screenshot = @browshot.screenshot_create()
|
148
148
|
assert_equal false, screenshot['error'].nil?, "Screenshot should have failed"
|
149
149
|
|
150
150
|
screenshot = @browshot.screenshot_create('-')
|
@@ -154,7 +154,7 @@ class TestBrowshot < Test::Unit::TestCase
|
|
154
154
|
|
155
155
|
should "create screenshot" do
|
156
156
|
# screenshot is not actually created for test account, so the reply may not match our parameters
|
157
|
-
screenshot = @browshot.screenshot_create('http://browshot.com/')
|
157
|
+
screenshot = @browshot.screenshot_create('http://browshot.com/')
|
158
158
|
|
159
159
|
assert_equal false, screenshot['id'].nil?, "Screenshot ID should be present"
|
160
160
|
assert_equal false, screenshot['status'].nil?, "Screenshot status should be present"
|
@@ -176,6 +176,7 @@ class TestBrowshot < Test::Unit::TestCase
|
|
176
176
|
assert_equal false, screenshot['final_url'].nil?, "Screenshot final_url should be present"
|
177
177
|
assert_equal false, screenshot['content_type'].nil?, "Screenshot content_type should be present"
|
178
178
|
assert_equal false, screenshot['scale'].nil?, "Screenshot scale should be present"
|
179
|
+
assert_equal false, screenshot['cost'].nil?, "Screenshot cost should be present"
|
179
180
|
end
|
180
181
|
end
|
181
182
|
|
@@ -185,12 +186,13 @@ class TestBrowshot < Test::Unit::TestCase
|
|
185
186
|
end
|
186
187
|
|
187
188
|
should "to retrieve a screenshot" do
|
188
|
-
screenshot = @browshot.screenshot_create('http://browshot.com/')
|
189
|
+
screenshot = @browshot.screenshot_create('http://browshot.com/')
|
189
190
|
info = @browshot.screenshot_info(screenshot['id'])
|
190
191
|
|
191
192
|
assert_equal false, info['id'].nil?, "Screenshot ID should be present"
|
192
193
|
assert_equal false, info['status'].nil?, "Screenshot status should be present"
|
193
194
|
assert_equal false, info['priority'].nil?, "Screenshot priority should be present"
|
195
|
+
assert_equal false, info['cost'].nil?, "Screenshot cost should be present"
|
194
196
|
|
195
197
|
if (info['status'] == 'finished')
|
196
198
|
assert_equal false, info['screenshot_url'].nil?, "Screenshot screenshot_url should be present"
|
@@ -212,7 +214,7 @@ class TestBrowshot < Test::Unit::TestCase
|
|
212
214
|
end
|
213
215
|
|
214
216
|
should "retrieve the list of screenshots" do
|
215
|
-
screenshots = @browshot.screenshot_list()
|
217
|
+
screenshots = @browshot.screenshot_list()
|
216
218
|
assert_equal true, screenshots.length > 0, "There should be multiple screenshots"
|
217
219
|
|
218
220
|
screenshot_id = 0
|
@@ -221,12 +223,13 @@ class TestBrowshot < Test::Unit::TestCase
|
|
221
223
|
break
|
222
224
|
end
|
223
225
|
|
224
|
-
assert_equal true, screenshot_id.to_i > 0, "
|
226
|
+
assert_equal true, screenshot_id.to_i > 0, "Screenshot ID should be positive"
|
225
227
|
screenshot = screenshots[screenshot_id]
|
226
228
|
|
227
229
|
assert_equal false, screenshot['id'].nil?, "Screenshot ID should be present"
|
228
230
|
assert_equal false, screenshot['status'].nil?, "Screenshot status should be present"
|
229
231
|
assert_equal false, screenshot['priority'].nil?, "Screenshot priority should be present"
|
232
|
+
assert_equal false, screenshot['cost'].nil?, "Screenshot cost should be present"
|
230
233
|
|
231
234
|
if (screenshot['status'] == 'finished')
|
232
235
|
assert_equal false, screenshot['screenshot_url'].nil?, "Screenshot screenshot_url should be present"
|
@@ -247,16 +250,16 @@ class TestBrowshot < Test::Unit::TestCase
|
|
247
250
|
end
|
248
251
|
end
|
249
252
|
|
250
|
-
should "retrieve a
|
253
|
+
should "retrieve a thumbnail" do
|
251
254
|
# TODO
|
252
255
|
end
|
253
256
|
|
254
257
|
should "retrieve account information" do
|
255
258
|
account = @browshot.account_info()
|
256
259
|
assert_equal false, account['balance'].nil?, "Account balance should be present"
|
257
|
-
assert_equal 0, account['balance'].to_i,
|
260
|
+
assert_equal 0, account['balance'].to_i, "Balance should be empty"
|
258
261
|
assert_equal false, account['active'].nil?, "Account active should be present"
|
259
|
-
assert_equal 1, account['active'].to_i,
|
262
|
+
assert_equal 1, account['active'].to_i, "Accountshould be active"
|
260
263
|
assert_equal false, account['instances'].nil?, "Account instances should be present"
|
261
264
|
end
|
262
265
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11
|
12
|
+
date: 2011-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
16
|
-
requirement: &
|
16
|
+
requirement: &245654200 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *245654200
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: url
|
27
|
-
requirement: &
|
27
|
+
requirement: &245652940 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *245652940
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: shoulda
|
38
|
-
requirement: &
|
38
|
+
requirement: &245448520 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *245448520
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
|
-
requirement: &
|
49
|
+
requirement: &245447720 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.0.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *245447720
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: jeweler
|
60
|
-
requirement: &
|
60
|
+
requirement: &245447060 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.6.4
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *245447060
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rcov
|
71
|
-
requirement: &
|
71
|
+
requirement: &245446360 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *245446360
|
80
80
|
description: ! 'Browshot (http://www.browshot.com/) is a web service to easily make
|
81
81
|
screenshots of web pages in any screen size, as any device: iPhone©, iPad©, Android©,
|
82
82
|
Nook©, PC, etc. Browshot has full Flash, JavaScript, CSS, & HTML5 support. The latest
|
@@ -119,7 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
segments:
|
121
121
|
- 0
|
122
|
-
hash:
|
122
|
+
hash: -318905846475433273
|
123
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
124
|
none: false
|
125
125
|
requirements:
|