popart 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/Gemfile.lock +1 -1
- data/README.md +12 -1
- data/bin/popart +1 -1
- data/example_config.yaml +9 -0
- data/lib/popart/config.rb +8 -6
- data/lib/popart/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 005aeee61238d9ab0c097656e5003e90eb72c639
|
4
|
+
data.tar.gz: 875d56fb6103b9f12c28b14cb2b9e572c8214f23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f471dfb57acc8d2db933a13e06a53166477ab2d1d8f2586f2d46aa99a3752856d832fa971d234e79b76ed192e2113190be4c3bfa6d205422ba3cc666e96a0c4d
|
7
|
+
data.tar.gz: 8b970bf409d82ad3c41ba5175a742f2f0473baf6faaa683728c4cd1402a2c5bad7da550446fc428db4188f663c4e4f32dfa06de57fd9b5151ee4c4a3c4ac0e57
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -28,6 +28,17 @@ To use Popart, install it (as above) then
|
|
28
28
|
|
29
29
|
This will cause Popart to take a shot with the default browsers (Chrome and Firefox Latest on Windows 10) and save them to `./screenshots`.
|
30
30
|
|
31
|
+
### Configuring browsers and output location
|
32
|
+
|
33
|
+
To configure further, copy `example_config.yaml` to your system, then customise to suit your requirements. Pass config files to Popart like so:
|
34
|
+
|
35
|
+
`popart url_to_screenshot location_of_config_file`
|
36
|
+
|
37
|
+
## Support
|
38
|
+
As an open source project, this is a volunteer effort. Be kind to the authors and maintainers, and expect support commensurate with what this product cost you: Nothing.
|
39
|
+
|
40
|
+
This is not an official Sauce Labs product. Do not ask their support department to assist with any issues; They are not responsible.
|
41
|
+
|
31
42
|
## Development
|
32
43
|
|
33
44
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -36,5 +47,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
36
47
|
|
37
48
|
## Contributing
|
38
49
|
|
39
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[
|
50
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[DylanLacey]/popart. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
40
51
|
|
data/bin/popart
CHANGED
@@ -14,7 +14,7 @@ screenshots = browsers.map do |browser|
|
|
14
14
|
session.screenshot_as :png
|
15
15
|
end
|
16
16
|
|
17
|
-
filename = browser.capabilities[
|
17
|
+
filename = browser.capabilities["browserName"] + '_' + browser.capabilities["version"] + '_' + browser.capabilities["platform"] + '.png'
|
18
18
|
filename.gsub! " ", "-"
|
19
19
|
|
20
20
|
File.open((File.join config.output_directory, filename), 'w') do |file|
|
data/example_config.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# Add a new line for each browser desired
|
2
|
+
#
|
3
|
+
# Values can be taken from the Platform Configurator: https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/
|
4
|
+
# Use the key names and values from the "Python" config
|
5
|
+
browsers:
|
6
|
+
- { browserName: "Chrome", platform: "Windows 7", version: "latest"}
|
7
|
+
- { browserName: "Safari", platform: "OS X 10.12", version: "latest"}
|
8
|
+
- { browserName: "Chrome", platform: "Linux", version: "45"}
|
9
|
+
output_directory: "./output"
|
data/lib/popart/config.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "pathname"
|
2
|
+
require "yaml"
|
2
3
|
|
3
4
|
module Popart
|
4
5
|
class Config
|
@@ -7,8 +8,8 @@ module Popart
|
|
7
8
|
|
8
9
|
def default_browsers
|
9
10
|
[
|
10
|
-
{
|
11
|
-
{
|
11
|
+
{"browserName" => 'Chrome', "platform" => "Windows 10", "version" => "latest"},
|
12
|
+
{"browserName" => 'Firefox', "platform" => "Windows 10", "version" => "latest"}
|
12
13
|
]
|
13
14
|
end
|
14
15
|
|
@@ -26,11 +27,12 @@ module Popart
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def load_from_file filename
|
29
|
-
|
30
|
+
filedata = File.read filename
|
31
|
+
config_hash = YAML.load(filedata)
|
30
32
|
|
31
|
-
@browsers = [config_hash[
|
32
|
-
@output_directory = config_hash[
|
33
|
-
@site = config_hash[
|
33
|
+
@browsers = [config_hash["browsers"]].flatten
|
34
|
+
@output_directory = config_hash["output_directory"]
|
35
|
+
@site = config_hash["site"]
|
34
36
|
end
|
35
37
|
|
36
38
|
def set_defaults
|
data/lib/popart/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: popart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Lacey
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- bin/console
|
103
103
|
- bin/popart
|
104
104
|
- bin/setup
|
105
|
+
- example_config.yaml
|
105
106
|
- lib/popart.rb
|
106
107
|
- lib/popart/browser.rb
|
107
108
|
- lib/popart/config.rb
|