chromedriver-helper 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: aeb1534f10f21b90d821911585b9231e30a3b797
4
+ data.tar.gz: e8588c1b71deb779a9a6b5bfaad10c6937897eed
5
+ SHA512:
6
+ metadata.gz: 5dbaf1558ca30899a678ea57919312909d990bbc3bdd572f8d8c687e937143f7a48a9c3882277c51222280959f42b8648354eac62bab31248c56ba988bdcc922
7
+ data.tar.gz: 9cc5a0194b9f805809bff9cd4080b39a4fce55b168541e4a05a1c43e808af543363df4f55a4658bd00592c1351c486ba2de683df7617be8a516859a60ad49643
@@ -1,16 +1,22 @@
1
1
  Changelog
2
2
  ==========
3
3
 
4
+ 0.0.6 - 26 Aug 2014
5
+ ----------
6
+
7
+ * Fixed to work with new Google download page. #7 (Thanks, @mars!)
8
+
9
+
4
10
  0.0.5 - 15 Aug 2012
5
11
  ----------
6
12
 
7
- * Fixed support for JRuby on non-Windows platforms.
13
+ * Fixed support for JRuby on non-Windows platforms. #4 (Thanks, Tim Olsen!)
8
14
 
9
15
 
10
16
  0.0.4 - 1 Aug 2012
11
17
  ----------
12
18
 
13
- * Including `chromedriver-update` to easily allow people to force-upgrade. (#3)
19
+ * Including `chromedriver-update` to easily allow people to force-upgrade. #3
14
20
 
15
21
 
16
22
  0.0.3 - 20 Mar 2012
@@ -16,6 +16,6 @@ Gem::Specification.new do |s|
16
16
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
17
  s.require_paths = ["lib"]
18
18
 
19
- s.add_development_dependency "rspec"
19
+ s.add_development_dependency "rspec", "~> 3.0"
20
20
  s.add_runtime_dependency "nokogiri"
21
21
  end
@@ -1,12 +1,10 @@
1
1
  require "chromedriver/helper/version"
2
2
  require "chromedriver/helper/google_code_parser"
3
3
  require 'fileutils'
4
- require 'open-uri'
5
4
  require 'rbconfig'
6
5
 
7
6
  module Chromedriver
8
7
  class Helper
9
- DOWNLOAD_URL = "http://code.google.com/p/chromedriver/downloads/list"
10
8
 
11
9
  def run *args
12
10
  download
@@ -18,11 +16,10 @@ module Chromedriver
18
16
  url = download_url
19
17
  filename = File.basename url
20
18
  Dir.chdir platform_install_dir do
21
- unless File.exists? filename
22
- system("wget -c -O #{filename} #{url}") || system("curl -C - -o #{filename} #{url}")
23
- raise "Could not download #{url}" unless File.exists? filename
24
- system "unzip -o #{filename}"
25
- end
19
+ system "rm #{filename}"
20
+ system("wget -c -O #{filename} #{url}") || system("curl -C - -o #{filename} #{url}")
21
+ raise "Could not download #{url}" unless File.exists? filename
22
+ system "unzip -o #{filename}"
26
23
  end
27
24
  raise "Could not unzip #{filename} to get #{binary_path}" unless File.exists? binary_path
28
25
  end
@@ -32,10 +29,7 @@ module Chromedriver
32
29
  end
33
30
 
34
31
  def download_url
35
- downloads = GoogleCodeParser.new(open(DOWNLOAD_URL)).downloads
36
- url = downloads.grep(/chromedriver_#{platform}_.*\.zip/).first
37
- url = "http:#{url}" if url !~ /^http/
38
- url
32
+ GoogleCodeParser.new(platform).newest_download
39
33
  end
40
34
 
41
35
  def binary_path
@@ -1,17 +1,27 @@
1
1
  require 'nokogiri'
2
+ require 'open-uri'
2
3
 
3
4
  module Chromedriver
4
5
  class Helper
5
6
  class GoogleCodeParser
6
- attr_reader :html
7
+ BUCKET_URL = 'http://chromedriver.storage.googleapis.com'
7
8
 
8
- def initialize html
9
- @html = html
9
+ attr_reader :source, :platform
10
+
11
+ def initialize(platform, open_uri_provider=OpenURI)
12
+ @platform = platform
13
+ @source = open_uri_provider.open_uri(BUCKET_URL)
10
14
  end
11
15
 
12
16
  def downloads
13
- doc = Nokogiri::HTML html
14
- doc.css("td.vt a[@title=Download]").collect {|_| _["href"]}
17
+ doc = Nokogiri::XML.parse(source)
18
+ items = doc.css("Contents Key").collect {|k| k.text }
19
+ items.reject! {|k| !(/chromedriver_#{platform}/===k) }
20
+ items.map {|k| "#{BUCKET_URL}/#{k}"}
21
+ end
22
+
23
+ def newest_download
24
+ downloads.last
15
25
  end
16
26
  end
17
27
  end
@@ -1,5 +1,5 @@
1
1
  module Chromedriver
2
2
  class Helper
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -0,0 +1 @@
1
+ <?xml version='1.0' encoding='UTF-8'?><ListBucketResult xmlns='http://doc.s3.amazonaws.com/2006-03-01'><Name>chromedriver</Name><Prefix></Prefix><Marker></Marker><IsTruncated>false</IsTruncated><Contents><Key>2.0/chromedriver_linux32.zip</Key><Generation>1380149859530000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:57:39.349Z</LastModified><ETag>"c0d96102715c4916b872f91f5bf9b12c"</ETag><Size>7262134</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.0/chromedriver_linux64.zip</Key><Generation>1380149860664000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:57:40.449Z</LastModified><ETag>"858ebaf47e13dce7600191ed59974c09"</ETag><Size>7433593</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.0/chromedriver_mac32.zip</Key><Generation>1380149857425000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:57:37.204Z</LastModified><ETag>"efc13db5afc518000d886c2bdcb3a4bc"</ETag><Size>7614601</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.0/chromedriver_win32.zip</Key><Generation>1380149858370000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:57:38.165Z</LastModified><ETag>"bbf8fd0fe525a06dda162619cac2b200"</ETag><Size>3048831</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.1/chromedriver_linux32.zip</Key><Generation>1380149869675000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:57:49.481Z</LastModified><ETag>"1d7e908253f7240d1596332082cc5742"</ETag><Size>7197760</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.1/chromedriver_linux64.zip</Key><Generation>1380149870889000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:57:50.738Z</LastModified><ETag>"de406b5a1aac2bfb2f419ac01d7231e2"</ETag><Size>7367074</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.1/chromedriver_mac32.zip</Key><Generation>1380149867471000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:57:47.251Z</LastModified><ETag>"41d718a956392c78d788eedd2e0723a5"</ETag><Size>7611294</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.1/chromedriver_win32.zip</Key><Generation>1380149868374000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:57:48.143Z</LastModified><ETag>"d48fd6bce0c6131caa8aad6b5b02b9aa"</ETag><Size>2961443</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.2/chromedriver_linux32.zip</Key><Generation>1380149878519000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:57:58.374Z</LastModified><ETag>"801b9f6c28a32575d8eae2abb1cdecd5"</ETag><Size>7252879</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.2/chromedriver_linux64.zip</Key><Generation>1380149879600000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:57:59.432Z</LastModified><ETag>"d5b73ee424717e45601553e91e204ad6"</ETag><Size>7417835</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.2/chromedriver_mac32.zip</Key><Generation>1380149876563000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:57:56.408Z</LastModified><ETag>"e904e2ed0ebcc453492a9fe0550665ee"</ETag><Size>7634565</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.2/chromedriver_win32.zip</Key><Generation>1380149877467000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:57:57.313Z</LastModified><ETag>"c86ce20925db2d16118559cbe6693c6f"</ETag><Size>2978752</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.3/chromedriver_linux32.zip</Key><Generation>1380149888081000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:58:07.947Z</LastModified><ETag>"f3af4d92060e6d61c2d2ed86ad584246"</ETag><Size>7310301</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.3/chromedriver_linux64.zip</Key><Generation>1380149889817000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:58:09.620Z</LastModified><ETag>"1a816cc185a15af4d450805629790b0a"</ETag><Size>7481138</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.3/chromedriver_mac32.zip</Key><Generation>1380149885736000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:58:05.567Z</LastModified><ETag>"4d72ca0fa6dbddfa1e42dbd1ef0045cc"</ETag><Size>7678021</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.3/chromedriver_win32.zip</Key><Generation>1380149886823000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:58:06.499Z</LastModified><ETag>"3226a146a6b97f2a111d3b2be9b0193f"</ETag><Size>3001138</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.3/notes.txt</Key><Generation>1380149888474000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T22:58:08.474Z</LastModified><ETag>"3ddc6ac82f5acc8d248b117146ab9b1b"</ETag><Size>591</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.4/chromedriver_linux32.zip</Key><Generation>1380606156436000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-10-01T05:42:36.371Z</LastModified><ETag>"3f8ef2f01a7fb5805bed2d644569acba"</ETag><Size>7365316</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.4/chromedriver_linux64.zip</Key><Generation>1380605124572000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-10-01T05:25:24.406Z</LastModified><ETag>"5e70555cbbf75e3480dd1629a35bc7e3"</ETag><Size>7536826</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.4/chromedriver_mac32.zip</Key><Generation>1380615154239000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-10-01T08:12:34.120Z</LastModified><ETag>"0816b2a06428962b1a2da103eb59323c"</ETag><Size>7727580</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>2.4/chromedriver_win32.zip</Key><Generation>1380667399987000</Generation><MetaGeneration>1</MetaGeneration><LastModified>2013-10-01T22:43:19.814Z</LastModified><ETag>"0280d3a9e713a38216a4e34a9ec1fba2"</ETag><Size>2980414</Size><Owner><ID>00b4903a97c5747d42831d561f5c5006971ba7454104797e276e7489aa9357d7</ID></Owner></Contents><Contents><Key>2.4/notes.txt</Key><Generation>1380605131079000</Generation><MetaGeneration>4</MetaGeneration><LastModified>2013-10-01T05:25:31.079Z</LastModified><ETag>"91ac3af6739a33188186e16c6a76d179"</ETag><Size>1089</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>icons/back.gif</Key><Generation>1380130924972000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T17:42:04.972Z</LastModified><ETag>"4bce9846e05d3bffdfb293d47c840a8e"</ETag><Size>216</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>icons/binary.gif</Key><Generation>1380130933627000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T17:42:13.627Z</LastModified><ETag>"96bd4beed88ff93356586485c13e5d89"</ETag><Size>246</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>icons/blank.gif</Key><Generation>1380130941334000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T17:42:21.333Z</LastModified><ETag>"19517fb39a31be6b8d7ccf53ad84908f"</ETag><Size>148</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>icons/folder.gif</Key><Generation>1380130950680000</Generation><MetaGeneration>2</MetaGeneration><LastModified>2013-09-25T17:42:30.680Z</LastModified><ETag>"d342cba375fea336967317bdb5d7cf19"</ETag><Size>225</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents><Contents><Key>index.html</Key><Generation>1380128358912000</Generation><MetaGeneration>3</MetaGeneration><LastModified>2013-09-25T16:59:18.911Z</LastModified><ETag>"704b0f841aad1b1428481b7ff3c759c0"</ETag><Size>10574</Size><Owner><ID>00b4903a97149f98c03d9e192e5baa7ac7cdac7c396df4e4648822c1c13b5bcd</ID></Owner></Contents></ListBucketResult>
@@ -1,27 +1,27 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Chromedriver::Helper::GoogleCodeParser do
4
- describe ".new" do
5
- it "takes HTML" do
6
- html = "<html><body><div>hello</div></body></html>"
7
- parser = Chromedriver::Helper::GoogleCodeParser.new html
8
- parser.html.should == html
4
+ let!(:open_uri_provider) do
5
+ double("open_uri_provider").tap do |oup|
6
+ allow(oup).to receive(:open_uri) { File.read(File.join(File.dirname(__FILE__), "assets/google-code-bucket.xml")) }
9
7
  end
10
8
  end
9
+ let!(:parser) { Chromedriver::Helper::GoogleCodeParser.new('mac', open_uri_provider) }
11
10
 
12
11
  describe "#downloads" do
13
- it "returns a hash of names and urls" do
14
- parser = Chromedriver::Helper::GoogleCodeParser.new File.read(File.join(File.dirname(__FILE__), "assets/google-code.html"))
15
- parser.downloads.should == [
16
- "//chromium.googlecode.com/files/chromedriver_win_16.0.902.0.zip",
17
- "//chromium.googlecode.com/files/chromedriver_mac_16.0.902.0.zip",
18
- "//chromium.googlecode.com/files/chromedriver_linux64_16.0.902.0.zip",
19
- "//chromium.googlecode.com/files/chromedriver_linux32_16.0.902.0.zip",
20
- "//chromium.googlecode.com/files/Chrome552.215.exe",
21
- "//chromium.googlecode.com/files/Chrome517.41.exe",
22
- "//chromium.googlecode.com/files/codesite.crx",
23
- "//chromium.googlecode.com/files/chromecomicJPGS.zip"
24
- ]
12
+ it "returns an array of URLs for the platform" do
13
+ expect(parser.downloads).to eq [
14
+ "http://chromedriver.storage.googleapis.com/2.0/chromedriver_mac32.zip",
15
+ "http://chromedriver.storage.googleapis.com/2.1/chromedriver_mac32.zip",
16
+ "http://chromedriver.storage.googleapis.com/2.2/chromedriver_mac32.zip",
17
+ "http://chromedriver.storage.googleapis.com/2.3/chromedriver_mac32.zip",
18
+ "http://chromedriver.storage.googleapis.com/2.4/chromedriver_mac32.zip"]
19
+ end
20
+ end
21
+
22
+ describe "#newest_download" do
23
+ it "returns the last URL for the platform" do
24
+ expect(parser.newest_download).to eq "http://chromedriver.storage.googleapis.com/2.4/chromedriver_mac32.zip"
25
25
  end
26
26
  end
27
27
  end
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chromedriver-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
5
- prerelease:
4
+ version: 0.0.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mike Dalessio
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-08-15 00:00:00.000000000 Z
11
+ date: 2014-08-26 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: '0'
19
+ version: '3.0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0'
26
+ version: '3.0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: nokogiri
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  description: Easy installation and use of chromedriver, the Chromium project's selenium
@@ -53,7 +48,7 @@ executables:
53
48
  extensions: []
54
49
  extra_rdoc_files: []
55
50
  files:
56
- - .gitignore
51
+ - ".gitignore"
57
52
  - CHANGELOG.md
58
53
  - Gemfile
59
54
  - README.md
@@ -64,32 +59,32 @@ files:
64
59
  - lib/chromedriver/helper.rb
65
60
  - lib/chromedriver/helper/google_code_parser.rb
66
61
  - lib/chromedriver/helper/version.rb
62
+ - spec/assets/google-code-bucket.xml
67
63
  - spec/assets/google-code.html
68
64
  - spec/google_code_parser_spec.rb
69
65
  - spec/spec_helper.rb
70
66
  homepage: ''
71
67
  licenses: []
68
+ metadata: {}
72
69
  post_install_message:
73
70
  rdoc_options: []
74
71
  require_paths:
75
72
  - lib
76
73
  required_ruby_version: !ruby/object:Gem::Requirement
77
- none: false
78
74
  requirements:
79
- - - ! '>='
75
+ - - ">="
80
76
  - !ruby/object:Gem::Version
81
77
  version: '0'
82
78
  required_rubygems_version: !ruby/object:Gem::Requirement
83
- none: false
84
79
  requirements:
85
- - - ! '>='
80
+ - - ">="
86
81
  - !ruby/object:Gem::Version
87
82
  version: '0'
88
83
  requirements: []
89
84
  rubyforge_project:
90
- rubygems_version: 1.8.24
85
+ rubygems_version: 2.2.2
91
86
  signing_key:
92
- specification_version: 3
87
+ specification_version: 4
93
88
  summary: Easy installation and use of chromedriver, the Chromium project's selenium
94
89
  webdriver adapter.
95
90
  test_files: []