chromedriver-helper-2.1.0/0000755000175000017500000000000013367632446020232 5ustar ruby_packagingruby_packagingchromedriver-helper-2.1.0/spec/0000755000175000017500000000000013367632446021164 5ustar ruby_packagingruby_packagingchromedriver-helper-2.1.0/spec/assets/0000755000175000017500000000000013367632446022466 5ustar ruby_packagingruby_packagingchromedriver-helper-2.1.0/spec/assets/google-code-bucket.xml0000644000175000017500000002216213367632446026652 0ustar ruby_packagingruby_packagingchromedriverfalse2.0/chromedriver_linux32.zip138014985953000022013-09-25T22:57:39.349Z"c0d96102715c4916b872f91f5bf9b12c"726213400b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.0/chromedriver_linux64.zip138014986066400022013-09-25T22:57:40.449Z"858ebaf47e13dce7600191ed59974c09"743359300b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.0/chromedriver_mac32.zip138014985742500022013-09-25T22:57:37.204Z"efc13db5afc518000d886c2bdcb3a4bc"761460100b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.0/chromedriver_win32.zip138014985837000022013-09-25T22:57:38.165Z"bbf8fd0fe525a06dda162619cac2b200"304883100b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.1/chromedriver_linux32.zip138014986967500022013-09-25T22:57:49.481Z"1d7e908253f7240d1596332082cc5742"719776000b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.1/chromedriver_linux64.zip138014987088900022013-09-25T22:57:50.738Z"de406b5a1aac2bfb2f419ac01d7231e2"736707400b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.1/chromedriver_mac32.zip138014986747100022013-09-25T22:57:47.251Z"41d718a956392c78d788eedd2e0723a5"761129400b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.1/chromedriver_win32.zip138014986837400022013-09-25T22:57:48.143Z"d48fd6bce0c6131caa8aad6b5b02b9aa"296144300b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.2/chromedriver_linux32.zip138014987851900022013-09-25T22:57:58.374Z"801b9f6c28a32575d8eae2abb1cdecd5"725287900b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.2/chromedriver_linux64.zip138014987960000022013-09-25T22:57:59.432Z"d5b73ee424717e45601553e91e204ad6"741783500b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.2/chromedriver_mac32.zip138014987656300022013-09-25T22:57:56.408Z"e904e2ed0ebcc453492a9fe0550665ee"763456500b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.2/chromedriver_win32.zip138014987746700022013-09-25T22:57:57.313Z"c86ce20925db2d16118559cbe6693c6f"297875200b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.3/chromedriver_linux32.zip138014988808100022013-09-25T22:58:07.947Z"f3af4d92060e6d61c2d2ed86ad584246"731030100b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.3/chromedriver_linux64.zip138014988981700022013-09-25T22:58:09.620Z"1a816cc185a15af4d450805629790b0a"748113800b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.3/chromedriver_mac32.zip138014988573600022013-09-25T22:58:05.567Z"4d72ca0fa6dbddfa1e42dbd1ef0045cc"767802100b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.3/chromedriver_win32.zip138014988682300022013-09-25T22:58:06.499Z"3226a146a6b97f2a111d3b2be9b0193f"300113800b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.3/notes.txt138014988847400022013-09-25T22:58:08.474Z"3ddc6ac82f5acc8d248b117146ab9b1b"59100b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.4/chromedriver_linux32.zip138060615643600022013-10-01T05:42:36.371Z"3f8ef2f01a7fb5805bed2d644569acba"736531600b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.4/chromedriver_linux64.zip138060512457200022013-10-01T05:25:24.406Z"5e70555cbbf75e3480dd1629a35bc7e3"753682600b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.4/chromedriver_mac32.zip138061515423900022013-10-01T08:12:34.120Z"0816b2a06428962b1a2da103eb59323c"772758000b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd2.4/chromedriver_win32.zip138066739998700012013-10-01T22:43:19.814Z"0280d3a9e713a38216a4e34a9ec1fba2"298041400b4903a97c5747d42831d561f5c5006971ba7454104797e276e7489aa9357d72.4/notes.txt138060513107900042013-10-01T05:25:31.079Z"91ac3af6739a33188186e16c6a76d179"108900b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcdicons/back.gif138013092497200022013-09-25T17:42:04.972Z"4bce9846e05d3bffdfb293d47c840a8e"21600b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcdicons/binary.gif138013093362700022013-09-25T17:42:13.627Z"96bd4beed88ff93356586485c13e5d89"24600b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcdicons/blank.gif138013094133400022013-09-25T17:42:21.333Z"19517fb39a31be6b8d7ccf53ad84908f"14800b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcdicons/folder.gif138013095068000022013-09-25T17:42:30.680Z"d342cba375fea336967317bdb5d7cf19"22500b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcdindex.html138012835891200032013-09-25T16:59:18.911Z"704b0f841aad1b1428481b7ff3c759c0"1057400b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcdchromedriver-helper-2.1.0/spec/assets/google-code.html0000644000175000017500000010163013367632446025541 0ustar ruby_packagingruby_packaging Downloads - chromium - An open-source browser project to help move the web forward. - Google Project Hosting
My favorites | Sign in
Project Home Downloads Wiki Issues
Search
for
  
  Filename Summary + Labels Uploaded ReleaseDate Size DownloadCount ...
chromedriver_win_16.0.902.0.zip ChromeDriver server for windows Oct 6 Oct 6 1011 KB 7352  
chromedriver_mac_16.0.902.0.zip ChromeDriver server for Mac OS X Oct 6 Oct 6 5.1 MB 2818  
chromedriver_linux64_16.0.902.0.zip ChromeDriver server for linux64 Oct 6 Oct 6 6.5 MB 2550  
chromedriver_linux32_16.0.902.0.zip ChromeDriver server for linux32 Oct 6 Oct 6 6.4 MB 2899  
Chrome552.215.exe 552.15 standalone installer Dec 2010 24.3 MB 64720  
Chrome517.41.exe 517.41 standalone installer Dec 2010 23.3 MB 2152  
codesite.crx Google Code enhancements for Chromium (Inlined images and fix svn path in issues) Jul 2009 1.3 KB 20575  
chromecomicJPGS.zip Google Chrome Comic Sep 2008 9.9 MB 20927  
  
Powered by Google Project Hosting
chromedriver-helper-2.1.0/spec/helper_spec.rb0000644000175000017500000000370113367632446024003 0ustar ruby_packagingruby_packagingrequire "spec_helper" describe Chromedriver::Helper do let(:helper) { Chromedriver::Helper.new } describe "#binary_path" do context "on a linux platform" do before { allow(helper).to receive(:platform) { "linux32" } } it { expect(helper.binary_path).to match(/chromedriver$/) } end context "on a windows platform" do before { allow(helper).to receive(:platform) { "win" } } it { expect(helper.binary_path).to match(/chromedriver\.exe$/) } end end describe '#platform' do os_cpu_matrix = [ { 'host_os' => 'darwin','host_cpu' => 'irrelevant', 'expected_platform' => 'mac' }, { 'host_os' => 'linux', 'host_cpu' => 'amd64', 'expected_platform' => 'linux64' }, { 'host_os' => 'linux', 'host_cpu' => 'irrelevant', 'expected_platform' => 'linux32' }, { 'host_os' => 'linux', 'host_cpu' => 'x86_64', 'expected_platform' => 'linux64' }, { 'host_os' => 'mingw', 'host_cpu' => 'irrelevant', 'expected_platform' => 'win' }, { 'host_os' => 'mswin', 'host_cpu' => 'irrelevant', 'expected_platform' => 'win' } ] os_cpu_matrix.each do |config| expected_platform = config['expected_platform'] host_cpu = config['host_cpu'] host_os = config['host_os'] context "given host OS #{host_os} and host CPU #{host_cpu}" do before do RbConfig.send(:remove_const, :CONFIG) RbConfig::CONFIG = { 'host_os' => host_os, 'host_cpu' => host_cpu } end it "returns #{expected_platform}" do expect(helper.platform).to eq(expected_platform) end end end context 'given an unknown host OS' do before do RbConfig.send(:remove_const, :CONFIG) RbConfig::CONFIG = { 'host_os' => 'freebsd', 'host_cpu' => 'irrelevant' } end it 'raises an exception' do expect { helper.platform }.to raise_error("Unsupported host OS 'freebsd'") end end end end chromedriver-helper-2.1.0/spec/google_code_parser_spec.rb0000644000175000017500000000303213367632446026343 0ustar ruby_packagingruby_packagingrequire "spec_helper" describe Chromedriver::Helper::GoogleCodeParser do let!(:open_uri_provider) do double("open_uri_provider").tap do |oup| allow(oup).to receive(:open_uri) do |uri| case uri.to_s when "https://chromedriver.storage.googleapis.com/LATEST_RELEASE" StringIO.new("2.42") when "https://chromedriver.storage.googleapis.com" StringIO.new(File.read(File.join(File.dirname(__FILE__), "assets/google-code-bucket.xml"))) end end end end let!(:parser) { Chromedriver::Helper::GoogleCodeParser.new('mac', open_uri_provider) } describe "#downloads" do it "returns an array of URLs for the platform" do expect(parser.downloads).to eq [ "https://chromedriver.storage.googleapis.com/2.0/chromedriver_mac32.zip", "https://chromedriver.storage.googleapis.com/2.1/chromedriver_mac32.zip", "https://chromedriver.storage.googleapis.com/2.2/chromedriver_mac32.zip", "https://chromedriver.storage.googleapis.com/2.3/chromedriver_mac32.zip", "https://chromedriver.storage.googleapis.com/2.4/chromedriver_mac32.zip"] end end describe "#newest_download_version" do it "returns the last URL for the platform" do expect(parser.newest_download_version).to eq Gem::Version.new("2.42") end end describe '#version_download_url' do it 'returns the version asked for' do expect(parser.version_download_url(2.0)).to eq "https://chromedriver.storage.googleapis.com/2.0/chromedriver_mac32.zip" end end end chromedriver-helper-2.1.0/spec/spec_helper.rb0000644000175000017500000000015513367632446024003 0ustar ruby_packagingruby_packagingrequire "rspec" require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib/chromedriver/helper")) chromedriver-helper-2.1.0/bin/0000755000175000017500000000000013367632446021002 5ustar ruby_packagingruby_packagingchromedriver-helper-2.1.0/bin/chromedriver-update0000755000175000017500000000013613367632446024701 0ustar ruby_packagingruby_packaging#! /usr/bin/env ruby require "chromedriver/helper" Chromedriver::Helper.new.update(ARGV[0]) chromedriver-helper-2.1.0/bin/chromedriver-helper0000755000175000017500000000013113367632446024671 0ustar ruby_packagingruby_packaging#! /usr/bin/env ruby require "chromedriver/helper" Chromedriver::Helper.new.run(*ARGV) chromedriver-helper-2.1.0/LICENSE.txt0000644000175000017500000000214213367632446022054 0ustar ruby_packagingruby_packaging(The MIT License) Copyright (c) 2011,2012,2013,2014,2015: [Mike Dalessio](http://mike.daless.io) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. chromedriver-helper-2.1.0/.travis.yml0000644000175000017500000000003613367632446022342 0ustar ruby_packagingruby_packaginglanguage: ruby rvm: - 2.1.0 chromedriver-helper-2.1.0/.gitignore0000644000175000017500000000016613367632446022225 0ustar ruby_packagingruby_packaging*.gem .bundle Gemfile.lock pkg/* chromedriver.log .tags concourse/private.yml concourse/chromedriver-helper.final.yml chromedriver-helper-2.1.0/README.md0000644000175000017500000001235013367632446021512 0ustar ruby_packagingruby_packaging# [chromedriver-helper](http://github.com/flavorjones/chromedriver-helper) [![Concourse CI](https://ci.nokogiri.org/api/v1/teams/nokogiri-core/pipelines/chromedriver-helper/jobs/ruby-2.5/badge)](https://ci.nokogiri.org/teams/nokogiri-core/pipelines/chromedriver-helper) Easy installation and use of [`chromedriver`](https://sites.google.com/a/chromium.org/chromedriver/), the Chromium project's Selenium webdriver adapter. # Description `chromedriver-helper` installs an executable, `chromedriver-helper`, in your gem path, and configures Selenium to invoke it as the web driver. This script will, if necessary, download the appropriate binary for your platform and install it into `~/.chromedriver-helper`, then exec it. Easy peasy! Individual projects can even select which version of `chromedriver` they want to run. # Usage ## In a Rails project If you're using Bundler and Capybara in a Rails project, it's as easy as: ``` ruby # Gemfile gem "selenium-webdriver" gem "chromedriver-helper" ``` then, in your spec setup: ``` ruby Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, :browser => :chrome) end ``` ## Standalone If you're using it standlone just to manage chromedriver binaries, # Gemfile gem "chromedriver-helper" Then just run the executable script: chromedriver-helper which will download `chromedriver` if necessary and exec it. # Configuration There are some commandline options that can be sent to `chromedriver` as options to `Capybara::Selenium::Driver.new`. The supported options can be discovered by looking at the Selenium source code here: https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/chrome/service.rb As of this writing, the supported options are: * `log_path` * `url_base` * `port_server` * `whitelisted_ips` * `verbose` * `silent` An example usage would be: ``` ruby Capybara::Selenium::Driver.new(app, browser: :chrome, driver_opts: { log_path: '/tmp/chrome.log', verbose: true }) ``` # Updating to latest `chromedriver` You can always update to the latest version of `chromedriver`: chromedriver-update ## Having problems updating? If for whatever reason you're having problems getting `chromedriver-helper` to update to the latest `chromedriver`, try this: 1. Delete the directory `$HOME/.chromedriver-helper` 2. Run `chromedriver-update` # Specifying a version If you want to run a specific version of `chromedriver` in your project, you can set the version in you testing setup like so: Chromedriver.set_version "2.24" Or, from the command line, you can choose a system-wide default: chromedriver-update 2.24 # Support The code lives at [http://github.com/flavorjones/chromedriver-helper](http://github.com/flavorjones/chromedriver-helper). Open a Github Issue, or send a pull request! Thanks! You're the best. # Known Issues ## `chromedriver-helper` affects other projects on my system v1.2.0 and earlier installed an executable named `chromedriver`, which may cause confusion for apps on your system that are _not_ using `chromedriver-helper`. v2.0.0 and later do not cause this problem. The common symptom is an error message that looks like this: ``` Selenium::WebDriver::Error::WebDriverError: unable to connect to chromedriver 127.0.0.1:9515 ``` First, confirm that we're talking about the same thing by running: ``` sh bundle exec ruby -e "system('chromedriver -v')" ``` and making sure you see something like: ``` .../rubygems_integration.rb:462:in `block in replace_bin_path': can't find executable chromedriver for gem chromedriver-helper (Gem::Exception) ``` If you see this message, then **uninstall all versions of `chromedriver-helper` prior to v2.0.0**; and make sure your other projects have updated to v2.0.0 or later. (You can read more about this issue at https://github.com/flavorjones/chromedriver-helper/issues/57.) ## CentOS 6 and 7 Some versions of `chromedriver` won't run on CentOS 6 and 7 due to the [problems explained here](https://chrome.richardlloyd.org.uk/). The error messages look something like: ``` chromedriver: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /home/vagrant/.chromedriver-helper/linux64/chromedriver) chromedriver: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.5' not found (required by /home/vagrant/.chromedriver-helper/linux64/chromedriver) chromedriver: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by /home/vagrant/.chromedriver-helper/linux64/chromedriver) ``` You can get `chromedriver` to work on these systems by running the `install_chrome.sh` script on the page linked to above, and then making sure your `chromedriver` process has `LD_LIBRARY_PATH` set so that `/opt/google/chrome/lib` is present, e.g. ``` $ LD_LIBRARY_PATH=/opt/google/chrome/lib chromedriver-helper Starting ChromeDriver 2.28.455506 (18f6627e265f442aeec9b6661a49fe819aeeea1f) on port 9515 Only local connections are allowed. ``` # License MIT licensed, see LICENSE.txt for full details. # Credit The idea for this gem comes from @brianhempel's project `chromedriver-gem` which, despite the name, is not currently published on http://rubygems.org/. Some improvements on the idea were taken from the installation process for standalone Phusion Passenger. chromedriver-helper-2.1.0/CHANGELOG.md0000644000175000017500000000545013367632446022047 0ustar ruby_packagingruby_packagingchromedriver-helper changelog ========== 2.1.0 - 2018-09-18 ---------- Enhancement: * Use the `LATEST_RELEASE` file to determine the newest version, to avoid downloading the experimental versions the Chrome team is posting recently. [#62](https://github.com/flavorjones/chromedriver-helper/issues/62) (Thanks, @ibrahima!) Bug fix: * `lib/chromedriver-helper.rb` explicitly requires `chromedriver/helper` to avoid "uninitialized constant Chromedriver" exception when calling `Chromedriver.set_version` in a default-configured Rails app. [#65](https://github.com/flavorjones/chromedriver-helper/issues/65) 2.0.1 - 2019-09-17 ---------- Bug fix: * Explicitly require 'selenium-webdriver' for projects who don't have the default Rails ordering in their Gemfile. [#60](https://github.com/flavorjones/chromedriver-helper/issues/60) (Thanks, @mattbrictson!) 2.0.0 - 2019-09-15 ---------- **Backwards-incompatible change:** The shadow executable `chromedriver` has been renamed to `chromedriver-helper` to work around issues with projects _not_ using the gem on a system on which the gem is installed. See [#57](https://github.com/flavorjones/chromedriver-helper/issues/57) for details. Many thanks to Miklós Fazekas (@mfazekas) for both reporting the issue and submitting the fix. 1.2.0 - 2018-02-03 ---------- Dependencies: * Bump dependencies on `nokogiri` and `archive-zip`. (Thanks, @odlp and @ksylvest!) Bug fixes: * Use `https` for the URL used to download. [#41] (Thanks, @saraid!) * Better platform detection, no longer run Windows on unrecognized platforms. [#49] (Thanks, @duncan-bayne!) * `chromedriver-update` without a version specified will update to the latest version available on the internets. [#47] 1.1.0 - 2017-03-19 ---------- Features: * Allow user to choose what version of chromedriver runs. [#34] (Thanks, @jonny5!) 1.0.0 - 2015-06-06 ---------- * Updated gemspec info. Happy 1.0! 0.0.9 - 2015-06-06 ---------- * No longer require 'curl' or 'wget', or 'unzip' utilities to be installed. You know, for Windows. (Thanks, @elementc!) * Support JRuby by removing dependency on native-C-extension gem. (Thanks, Marques Lee!) 0.0.8 - 2015-01-23 ---------- * Guaranteeing that we get the *latest* version of chromedriver. (#15) (Thanks, @AlexRiedler!) 0.0.7 - 26 Aug 2014 ---------- * Added support for windows binaries. (Thanks, @elementc!) 0.0.6 - 26 Aug 2014 ---------- * Fixed to work with new Google download page. #7 (Thanks, @mars!) 0.0.5 - 15 Aug 2012 ---------- * Fixed support for JRuby on non-Windows platforms. #4 (Thanks, Tim Olsen!) 0.0.4 - 1 Aug 2012 ---------- * Including `chromedriver-update` to easily allow people to force-upgrade. #3 0.0.3 - 20 Mar 2012 ---------- * Updated download URL. #2 (Thanks, Alistair Hutchison!) 0.0.2 - 6 December 2011 ---------- * Birthday! chromedriver-helper-2.1.0/Rakefile0000644000175000017500000000027513367632446021703 0ustar ruby_packagingruby_packagingrequire "bundler/gem_tasks" require 'rspec/core/rake_task' require 'concourse' RSpec::Core::RakeTask.new(:spec) task :default => :spec Concourse.new("chromedriver-helper").create_tasks! chromedriver-helper-2.1.0/chromedriver-helper.gemspec0000644000175000017500000000236313367632446025551 0ustar ruby_packagingruby_packaging# -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) require "chromedriver/helper/version" def windows? RbConfig::CONFIG['target_os'] =~ /mingw32|mswin/ end Gem::Specification.new do |s| s.name = "chromedriver-helper" s.version = Chromedriver::Helper::VERSION s.authors = ["Mike Dalessio"] s.email = ["mike.dalessio@gmail.com"] s.homepage = "https://github.com/flavorjones/chromedriver-helper" s.summary = "Easy installation and use of chromedriver." s.description = "Easy installation and use of chromedriver, the Chromium project's selenium webdriver adapter." s.licenses = ["MIT"] begin s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } rescue Exception => e warn "WARNING: could not set spec.files: #{e.class}: #{e}" end s.require_paths = ["lib"] s.add_development_dependency "rspec", "~> 3.0" s.add_development_dependency "rake", "~> 10.0" s.add_development_dependency "concourse", "~> 0.16" s.add_runtime_dependency "nokogiri", "~> 1.8" s.add_runtime_dependency "archive-zip", "~> 0.10" end chromedriver-helper-2.1.0/concourse/0000755000175000017500000000000013367632446022232 5ustar ruby_packagingruby_packagingchromedriver-helper-2.1.0/concourse/chromedriver-helper.yml0000644000175000017500000001254713367632446026734 0ustar ruby_packagingruby_packaginganchors: notify_failure_to_pr: ¬ify_failure_to_pr put: chromedriver-helper-pr params: {path: chromedriver-helper-pr, status: failure} groups: - name: master jobs: % RUBIES[:mri].last(2).each do |ruby_version| - ruby-<%= ruby_version %> % end % RUBIES[:jruby].last(2).each do |ruby_version| - jruby-<%= ruby_version %> % end - name: PRs jobs: - pr-pending % RUBIES[:mri].last(1).each do |ruby_version| - ruby-<%= ruby_version %>-pr % end % RUBIES[:jruby].last(1).each do |ruby_version| - jruby-<%= ruby_version %>-pr % end - pr-success - name: allow-failure jobs: % RUBIES[:windows].last(2).each do |ruby_version| - win-ruby-<%= ruby_version %>-devkit % end resource_types: - name: pull-request type: docker-image source: repository: jtarchie/pr resources: - name: ci type: git source: uri: https://github.com/flavorjones/chromedriver-helper/ branch: master disable_ci_skip: true # always get the latest pipeline configuration - name: chromedriver-helper type: git source: uri: https://github.com/flavorjones/chromedriver-helper/ branch: master ignore_paths: - concourse/** - name: chromedriver-helper-pr type: pull-request source: repo: flavorjones/chromedriver-helper access_token: {{github-repo-status-access-token}} ignore_paths: - concourse/** jobs: % RUBIES[:mri].last(2).each do |ruby_version| - name: ruby-<%= ruby_version %> public: true plan: - get: ci - get: chromedriver-helper trigger: true - task: rake-test config: platform: linux image_resource: type: docker-image source: {repository: ruby, tag: "<%= ruby_version %>"} inputs: - name: ci - name: chromedriver-helper run: path: ci/concourse/tasks/rake-test/run.sh % end % RUBIES[:windows].last(2).each do |ruby_version| - name: win-ruby-<%= ruby_version %>-devkit public: true plan: - get: ci - get: chromedriver-helper trigger: true - task: rake-test config: platform: windows inputs: - name: ci - name: chromedriver-helper params: WIN_RUBY_VERSION: "<%= ruby_version %>" run: path: powershell args: ["-File", "ci/concourse/tasks/rake-test/run.ps1"] % end % RUBIES[:jruby].last(2).each do |ruby_version| - name: jruby-<%= ruby_version %> public: true plan: - get: ci - get: chromedriver-helper trigger: true - task: rake-test config: platform: linux image_resource: type: docker-image source: {repository: jruby, tag: "<%= ruby_version %>-jdk"} inputs: - name: ci - name: chromedriver-helper params: JAVA_OPTS: "-Dfile.encoding=UTF8" # https://github.com/docker-library/openjdk/issues/32 run: path: ci/concourse/tasks/rake-test/run.sh % end # # PRs # - name: pr-pending public: true plan: - get: ci - get: chromedriver-helper-pr trigger: true version: every - put: chromedriver-helper-pr params: {path: chromedriver-helper-pr, status: pending} % RUBIES[:mri].last(1).each do |ruby_version| - name: ruby-<%= ruby_version %>-pr public: true max_in_flight: 1 plan: - get: ci - get: chromedriver-helper-pr trigger: true version: every passed: [pr-pending] - task: rake-test config: platform: linux image_resource: type: docker-image source: {repository: ruby, tag: "<%= ruby_version %>"} inputs: - name: ci - name: chromedriver-helper-pr path: chromedriver-helper run: path: ci/concourse/tasks/rake-test/run.sh on_failure: *notify_failure_to_pr % end % RUBIES[:jruby].last(1).each do |ruby_version| - name: jruby-<%= ruby_version %>-pr public: true max_in_flight: 1 plan: - get: ci - get: chromedriver-helper-pr trigger: true version: every passed: [pr-pending] - task: rake-test attempts: 3 config: platform: linux image_resource: type: docker-image source: {repository: jruby, tag: "<%= ruby_version %>-jdk"} inputs: - name: ci - name: chromedriver-helper-pr path: chromedriver-helper params: JAVA_OPTS: "-Dfile.encoding=UTF8" # https://github.com/docker-library/openjdk/issues/32 run: path: ci/concourse/tasks/rake-test/run.sh on_failure: *notify_failure_to_pr % end - name: pr-success public: true disable_manual_trigger: true plan: - get: chromedriver-helper-pr trigger: true version: every passed: % RUBIES[:mri].last(1).each do |ruby_version| - ruby-<%= ruby_version %>-pr % end % RUBIES[:jruby].last(1).each do |ruby_version| - jruby-<%= ruby_version %>-pr % end - put: chromedriver-helper-pr params: {path: chromedriver-helper-pr, status: success} chromedriver-helper-2.1.0/concourse/tasks/0000755000175000017500000000000013367632446023357 5ustar ruby_packagingruby_packagingchromedriver-helper-2.1.0/concourse/tasks/rake-test/0000755000175000017500000000000013367632446025256 5ustar ruby_packagingruby_packagingchromedriver-helper-2.1.0/concourse/tasks/rake-test/run.sh0000755000175000017500000000022613367632446026421 0ustar ruby_packagingruby_packaging#! /usr/bin/env bash set -e -x -u export NOKOGIRI_USE_SYSTEM_LIBRARIES=t pushd chromedriver-helper bundle install bundle exec rake spec popd chromedriver-helper-2.1.0/concourse/tasks/rake-test/run.ps10000644000175000017500000000033213367632446026505 0ustar ruby_packagingruby_packaging. "c:\var\vcap\packages\windows-ruby-dev-tools\prelude.ps1" push-location chromedriver-helper system-cmd "gem install bundler" system-cmd "bundle install" system-cmd "bundle exec rake spec" pop-location chromedriver-helper-2.1.0/Gemfile0000644000175000017500000000014713367632446021527 0ustar ruby_packagingruby_packagingsource "http://rubygems.org" # Specify your gem's dependencies in chromedriver-helper.gemspec gemspec chromedriver-helper-2.1.0/lib/0000755000175000017500000000000013367632446021000 5ustar ruby_packagingruby_packagingchromedriver-helper-2.1.0/lib/chromedriver-helper.rb0000644000175000017500000000023613367632446025274 0ustar ruby_packagingruby_packagingrequire 'chromedriver/helper' require 'selenium-webdriver' Selenium::WebDriver::Chrome.driver_path=Gem.bin_path("chromedriver-helper","chromedriver-helper") chromedriver-helper-2.1.0/lib/chromedriver/0000755000175000017500000000000013367632446023471 5ustar ruby_packagingruby_packagingchromedriver-helper-2.1.0/lib/chromedriver/helper.rb0000644000175000017500000000605713367632446025305 0ustar ruby_packagingruby_packagingrequire "chromedriver/helper/version" require "chromedriver/helper/google_code_parser" require 'fileutils' require 'rbconfig' require 'open-uri' require 'archive/zip' module Chromedriver def self.set_version(version) Chromedriver::Helper.new.update(version) end class Helper def run(*args) download exec binary_path, *args end def download(hit_network = false) return if File.exist?(binary_path) && !hit_network raise "Version not found for #{download_version}" unless download_url filename = File.basename download_url Dir.chdir platform_install_dir do FileUtils.rm_f filename File.open(filename, "wb") do |saved_file| URI.parse(download_url).open("rb") do |read_file| saved_file.write(read_file.read) end end raise "Could not download #{download_url}" unless File.exists? filename Archive::Zip.extract(filename, '.', :overwrite => :all) end raise "Could not unzip #{filename} to get #{binary_path}" unless File.exists? binary_path FileUtils.chmod "ugo+rx", binary_path File.open(version_path, 'w') { |file| file.write(download_version) } end def update(version = nil) @download_version = version || google_code_parser.newest_download_version.to_s hit_network = (current_version != download_version) ? true : false download(hit_network) end def current_version @current_version ||= if File.exist?(version_path) File.read(version_path).strip end end def download_version @download_version ||= current_version || google_code_parser.newest_download_version.to_s end def download_url @download_url ||= google_code_parser.version_download_url(download_version) end def google_code_parser @google_code_parser ||= GoogleCodeParser.new(platform) end def version_path @version_path ||= File.join(base_install_dir, ".chromedriver-version") end def binary_path if platform == "win" File.join platform_install_dir, "chromedriver.exe" else File.join platform_install_dir, "chromedriver" end end def platform_install_dir dir = File.join version_install_dir, platform FileUtils.mkdir_p dir dir end def version_install_dir dir = File.expand_path File.join(base_install_dir, download_version) FileUtils.mkdir_p dir dir end def base_install_dir @base_install_dir ||= begin dir = File.expand_path File.join(ENV['HOME'], ".chromedriver-helper") FileUtils.mkdir_p dir dir end end def platform cfg = RbConfig::CONFIG host_cpu = cfg["host_cpu"] host_os = cfg["host_os"] case host_os when /linux/ then host_cpu =~ /x86_64|amd64/ ? "linux64" : "linux32" when /darwin/ then "mac" when /mswin/ then "win" when /mingw/ then "win" else raise("Unsupported host OS '#{host_os}'") end end end end chromedriver-helper-2.1.0/lib/chromedriver/helper/0000755000175000017500000000000013367632446024750 5ustar ruby_packagingruby_packagingchromedriver-helper-2.1.0/lib/chromedriver/helper/version.rb0000644000175000017500000000010313367632446026754 0ustar ruby_packagingruby_packagingmodule Chromedriver class Helper VERSION = "2.1.0" end end chromedriver-helper-2.1.0/lib/chromedriver/helper/google_code_parser.rb0000644000175000017500000000243713367632446031125 0ustar ruby_packagingruby_packagingrequire 'nokogiri' require 'open-uri' require 'uri' module Chromedriver class Helper class GoogleCodeParser BUCKET_URL = 'https://chromedriver.storage.googleapis.com' attr_reader :source, :platform, :newest_download_version def initialize(platform, open_uri_provider=OpenURI) @platform = platform @source = open_uri_provider.open_uri(BUCKET_URL) @newest_download_version = Gem::Version.new(open_uri_provider.open_uri(URI.join(BUCKET_URL, "LATEST_RELEASE")).read) end def downloads @downloads ||= begin doc = Nokogiri::XML.parse(source) items = doc.css("Contents Key").collect {|k| k.text } items.reject! {|k| !(/chromedriver_#{platform}/===k) } items.map {|k| "#{BUCKET_URL}/#{k}"} end end def version_download_url(version) gem_version = Gem::Version.new(version) downloads.find { |download_url| version_of(download_url) == gem_version } end private def version_of url Gem::Version.new grab_version_string_from(url) end def grab_version_string_from url # assumes url is of form similar to http://chromedriver.storage.googleapis.com/2.3/chromedriver_mac32.zip url.split("/")[3] end end end end chromedriver-helper-2.1.0/.rspec0000644000175000017500000000005613367632446021350 0ustar ruby_packagingruby_packaging--color --format=documentation --order=random