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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e828b5786140a4a44daac950d186cbe9155efba
4
- data.tar.gz: d40bd424a2ef9e3f1d0bf96771dc0fc0a5bcf4dc
3
+ metadata.gz: 005aeee61238d9ab0c097656e5003e90eb72c639
4
+ data.tar.gz: 875d56fb6103b9f12c28b14cb2b9e572c8214f23
5
5
  SHA512:
6
- metadata.gz: ceaab1659a2b41dec717f68a2871df7adb2ff39d6a667e17d208f49dd1ff10cbccb8d0deed1ea79511d0b4e469d508e26f9b658eeb28bddbbf6e4f7a5554f5d7
7
- data.tar.gz: 179957657ec3307c7462551f88acbbe7c08297ce9fff9bf769528a3b1ce89c53aaa8bf04daeaf458fd785134b04d57278a1af8da57987f7f6e883f0580d4e1fb
6
+ metadata.gz: f471dfb57acc8d2db933a13e06a53166477ab2d1d8f2586f2d46aa99a3752856d832fa971d234e79b76ed192e2113190be4c3bfa6d205422ba3cc666e96a0c4d
7
+ data.tar.gz: 8b970bf409d82ad3c41ba5175a742f2f0473baf6faaa683728c4cd1402a2c5bad7da550446fc428db4188f663c4e4f32dfa06de57fd9b5151ee4c4a3c4ac0e57
data/CHANGELOG.md CHANGED
@@ -1,4 +1,6 @@
1
1
  # 0
2
2
  ## 0.1
3
+ ### 1.1.2
4
+ Added YAML file parsing to specify browsers better
3
5
  ### 0.1.1
4
6
  Allowed for gem pushes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- popart (0.1.1)
4
+ popart (0.1.2)
5
5
  parallel
6
6
  selenium-webdriver
7
7
 
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/[USERNAME]/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.
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[:browserName] + '_' + browser.capabilities[:version] + '_' + browser.capabilities[:platform] + '.png'
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|
@@ -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
- {:browserName => 'Chrome', :platform => "Windows 10", :version => "latest"},
11
- {:browserName => 'Firefox', :platform => "Windows 10", :version => "latest"}
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
- config_hash = YAML.parse filename
30
+ filedata = File.read filename
31
+ config_hash = YAML.load(filedata)
30
32
 
31
- @browsers = [config_hash[:browsers]].flatten
32
- @output_directory = config_hash[:output_directory]
33
- @site = config_hash[:site]
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
@@ -1,3 +1,3 @@
1
1
  module Popart
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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