screenshooter 0.0.2 → 0.0.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.
- checksums.yaml +4 -4
- data/README.md +32 -10
- data/lib/screenshooter.rb +7 -1
- data/lib/screenshooter/version.rb +1 -1
- data/sample_browsers.json +25 -0
- metadata +15 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b82464223749cf704d94416b74d77b6e7701f81d
|
4
|
+
data.tar.gz: 9bec8928327bff1ea369246db1adc2c43416f5bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30485e65add1afdd7acd406cdf56de9d6812287d55993abb96586858ba0921e74e013b2499b11c7847e0b82aa8a304c6790e53839e5add75ed9128098e8257fe
|
7
|
+
data.tar.gz: e12941358cc7f27ce3596ca29be0dd51e91a6f85d1e0cb3cef88d97e8374eafa75230595242ab9c0b801ed07532336e036d45d7d904ca618bbfb09b312e25c16
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ You should set up your credentials in the `.browserstack` file in your
|
|
24
24
|
home directory. It should look like this:
|
25
25
|
|
26
26
|
username:auth_token
|
27
|
-
|
27
|
+
|
28
28
|
Your authentication token is available under the
|
29
29
|
[automation section](https://www.browserstack.com/accounts/automate-keys)
|
30
30
|
of your profile.
|
@@ -32,18 +32,39 @@ of your profile.
|
|
32
32
|
Next you'll need a browser configuration file. This will be used to
|
33
33
|
specify which browser versions under which operating systems to take
|
34
34
|
screenshots. You can start with the sample included in this project,
|
35
|
-
`sample_browsers.yaml`.
|
35
|
+
`sample_browsers.yaml` or `sample_browsers.json`.
|
36
36
|
|
37
37
|
## Using
|
38
38
|
|
39
|
-
|
39
|
+
For each URL provided, screenshooter will return a BrowserStack
|
40
|
+
screenshot gallery URL.
|
41
|
+
|
42
|
+
General use is pretty straightforward:
|
43
|
+
|
44
|
+
screenshooter shoot path_to/browsers.yaml
|
40
45
|
|
41
|
-
|
46
|
+
If you are using a json file, then:
|
47
|
+
|
48
|
+
screenshooter shoot path_to/browsers.json
|
42
49
|
|
43
50
|
Once the request is successfully made, the program will return the URL
|
44
51
|
of the screenshot collection. The URL output can be piped to another
|
45
52
|
service.
|
46
53
|
|
54
|
+
### Commands
|
55
|
+
|
56
|
+
screenshooter browsers list
|
57
|
+
screenshooter browsers search
|
58
|
+
screenshooter shoot
|
59
|
+
|
60
|
+
### Arguments and options
|
61
|
+
|
62
|
+
screenshooter browsers list
|
63
|
+
screenshooter browsers search <SEARCH TERM>
|
64
|
+
screenshooter shoot -u <URL>
|
65
|
+
screenshooter shoot -u <URL> -u <URL> -u <URL>
|
66
|
+
screenshooter shoot -u <URL> -b <BROSWER JSON SPEC>
|
67
|
+
|
47
68
|
### Setting the URL
|
48
69
|
|
49
70
|
You don't need to include the URL in your configuration file. It might
|
@@ -51,7 +72,7 @@ be helpful if you're always taking screenshots of the same URL, but
|
|
51
72
|
chances are you'll probably want to specify this each time you run the
|
52
73
|
command.
|
53
74
|
|
54
|
-
screenshooter path_to/browsers.yaml -u http://www.github.com
|
75
|
+
screenshooter shoot path_to/browsers.yaml -u http://www.github.com
|
55
76
|
|
56
77
|
### Waiting for completion
|
57
78
|
|
@@ -59,13 +80,14 @@ The command accepts an optional boolean flag, `wait`, which will check
|
|
59
80
|
every 2.5 seconds on the status of the request and return the URL once
|
60
81
|
the job is complete.
|
61
82
|
|
62
|
-
screenshooter path_to/browsers.yaml -u http://www.github.com -w
|
63
|
-
screenshooter path_to/browsers.yaml -u http://www.github.com --wait
|
64
|
-
|
83
|
+
screenshooter shoot path_to/browsers.yaml -u http://www.github.com -w
|
84
|
+
screenshooter shoot path_to/browsers.yaml -u http://www.github.com --wait
|
85
|
+
|
65
86
|
### Open the screenshots URL
|
66
87
|
|
67
88
|
The command accepts an optional boolean flag, `open`, which will open
|
68
89
|
the screenshots URL in your default browser.
|
69
90
|
|
70
|
-
screenshooter path_to/browsers.yaml -u http://www.github.com -o
|
71
|
-
screenshooter path_to/browsers.yaml -u http://www.github.com --open
|
91
|
+
screenshooter shoot path_to/browsers.yaml -u http://www.github.com -o
|
92
|
+
screenshooter shoot path_to/browsers.yaml -u http://www.github.com --open
|
93
|
+
|
data/lib/screenshooter.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'thor'
|
3
3
|
require 'yaml'
|
4
|
+
require 'json'
|
4
5
|
require 'launchy'
|
5
6
|
require 'progress_bar'
|
6
7
|
require 'screenshot'
|
@@ -33,7 +34,12 @@ module ScreenShooter
|
|
33
34
|
def shoot(file="browsers.yaml")
|
34
35
|
username, password = get_credentials
|
35
36
|
client = Screenshot::Client.new({"username" => username, "password" => password})
|
36
|
-
|
37
|
+
file_extension = file.split('.')[-1]
|
38
|
+
if file_extension == 'yaml'
|
39
|
+
params = YAML::load( File.open( file ) )
|
40
|
+
elsif file_extension == 'json'
|
41
|
+
params = JSON.parse( File.read(file) )
|
42
|
+
end
|
37
43
|
if options.has_key? "url"
|
38
44
|
params["url"] = options["url"]
|
39
45
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"url": "http://www.github.com",
|
3
|
+
"browsers": [
|
4
|
+
{ "browser": "firefox",
|
5
|
+
"browser_version": "20.0",
|
6
|
+
"os": "Windows",
|
7
|
+
"os_version": "7"
|
8
|
+
},
|
9
|
+
{ "browser": "firefox",
|
10
|
+
"browser_version": "19.0",
|
11
|
+
"os": "Windows",
|
12
|
+
"os_version": "7"
|
13
|
+
},
|
14
|
+
{ "browser": "ie",
|
15
|
+
"browser_version": "9.0",
|
16
|
+
"os": "Windows",
|
17
|
+
"os_version": "7"
|
18
|
+
},
|
19
|
+
{ "browser": "chrome",
|
20
|
+
"browser_version": "28.0",
|
21
|
+
"os": "Windows",
|
22
|
+
"os_version": "7"
|
23
|
+
}
|
24
|
+
]
|
25
|
+
}
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: screenshooter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Lopatin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: browserstack-screenshot
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: launchy
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: progress_bar
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: A tool for generating BrowserStack screenshots from the command line.
|
@@ -74,7 +74,7 @@ executables:
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
-
- .gitignore
|
77
|
+
- ".gitignore"
|
78
78
|
- Gemfile
|
79
79
|
- LICENSE
|
80
80
|
- README.md
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- bin/screenshooter
|
83
83
|
- lib/screenshooter.rb
|
84
84
|
- lib/screenshooter/version.rb
|
85
|
+
- sample_browsers.json
|
85
86
|
- sample_browsers.yaml
|
86
87
|
- screenshooter.gemspec
|
87
88
|
homepage: http://www.github.com/bennylope/screenshooter
|
@@ -94,17 +95,17 @@ require_paths:
|
|
94
95
|
- lib
|
95
96
|
required_ruby_version: !ruby/object:Gem::Requirement
|
96
97
|
requirements:
|
97
|
-
- -
|
98
|
+
- - ">="
|
98
99
|
- !ruby/object:Gem::Version
|
99
100
|
version: '0'
|
100
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
102
|
requirements:
|
102
|
-
- -
|
103
|
+
- - ">="
|
103
104
|
- !ruby/object:Gem::Version
|
104
105
|
version: '0'
|
105
106
|
requirements: []
|
106
107
|
rubyforge_project: screenshooter
|
107
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.4.1
|
108
109
|
signing_key:
|
109
110
|
specification_version: 4
|
110
111
|
summary: A tool for generating BrowserStack screenshots from the command line.
|