chromedriver-helper 0.0.8 → 0.0.9

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: 4f5054f78e2f529cc6a450f5b791eef2bde67a7d
4
- data.tar.gz: eb706a2bf947127267e409f02ec42b302cdfee3a
3
+ metadata.gz: 6db58e06cd4b8661e977c103d59ba0aa28ea5d16
4
+ data.tar.gz: f9216196e92af08f87a8bea8c1ec39a87b3cd2ee
5
5
  SHA512:
6
- metadata.gz: 81ae656e4004080b694b81734a4306a985be18cd72a070fd64baa0382c4e76e1b0408d82e68a3521765a322bc823b958dacb58ef6b1a174014509f06980731fa
7
- data.tar.gz: be82f10897dbc666a45c54afe8afa57e9ee251dbafef1802b4dba2d33fd7d0a3dc6ef015e0b3d09d48b37b18213af29d7bb407ae610d129011f4ef45fa556add
6
+ metadata.gz: 6bb7045aff7e6986e473bee264ef149a972e3db6030ce589bc18bada97b29d4ff426fe151d79b236a3454371fe77153fb1746fa5afd553d33b23556b001ba40c
7
+ data.tar.gz: 1e5e72f030feb313ea47a2f02fb12613b45cf67ffa25caba45468398964c2956e46124aeb89b053c3aabb5bb54c6dd2233c9131055ce027089c3a8f20ec0b626
@@ -1,6 +1,19 @@
1
1
  Changelog
2
2
  ==========
3
3
 
4
+ 0.0.9 - 2015-06-06
5
+ ----------
6
+
7
+ * No longer require 'curl' or 'wget', or 'unzip' utilities to be installed. You know, for Windows. (Thanks, @elementc!)
8
+ * Support JRuby by removing dependency on native-C-extension gem. (Thanks, Marques Lee!)
9
+
10
+
11
+ 0.0.8 - 2015-01-23
12
+ ----------
13
+
14
+ * Guaranteeing that we get the *latest* version of chromedriver. (#15) (Thanks, @AlexRiedler!)
15
+
16
+
4
17
  0.0.7 - 26 Aug 2014
5
18
  ----------
6
19
 
@@ -19,5 +19,5 @@ Gem::Specification.new do |s|
19
19
  s.add_development_dependency "rspec", "~> 3.0"
20
20
  s.add_development_dependency "rake"
21
21
  s.add_runtime_dependency "nokogiri", "~> 1.6"
22
- s.add_runtime_dependency "version_sorter", "~> 1.1"
22
+ s.add_runtime_dependency "archive-zip", "~> 0.7.0"
23
23
  end
@@ -2,6 +2,8 @@ require "chromedriver/helper/version"
2
2
  require "chromedriver/helper/google_code_parser"
3
3
  require 'fileutils'
4
4
  require 'rbconfig'
5
+ require 'open-uri'
6
+ require 'archive/zip'
5
7
 
6
8
  module Chromedriver
7
9
  class Helper
@@ -16,12 +18,17 @@ module Chromedriver
16
18
  url = download_url
17
19
  filename = File.basename url
18
20
  Dir.chdir platform_install_dir do
19
- system "rm #{filename}"
20
- system("wget -c -O #{filename} #{url}") || system("curl -C - -o #{filename} #{url}")
21
+ FileUtils.rm_f filename
22
+ File.open(filename, "wb") do |saved_file|
23
+ URI.parse(url).open("rb") do |read_file|
24
+ saved_file.write(read_file.read)
25
+ end
26
+ end
21
27
  raise "Could not download #{url}" unless File.exists? filename
22
- system "unzip -o #{filename}"
28
+ Archive::Zip.extract(filename, '.', :overwrite => :all)
23
29
  end
24
30
  raise "Could not unzip #{filename} to get #{binary_path}" unless File.exists? binary_path
31
+ FileUtils.chmod "ugo+rx", binary_path
25
32
  end
26
33
 
27
34
  def update
@@ -1,6 +1,5 @@
1
1
  require 'nokogiri'
2
2
  require 'open-uri'
3
- require 'version_sorter'
4
3
 
5
4
  module Chromedriver
6
5
  class Helper
@@ -22,7 +21,18 @@ module Chromedriver
22
21
  end
23
22
 
24
23
  def newest_download
25
- VersionSorter.sort(downloads).last
24
+ (downloads.sort { |a, b| version_of(a) <=> version_of(b)}).last
25
+ end
26
+
27
+ private
28
+
29
+ def version_of url
30
+ Gem::Version.new grab_version_string_from(url)
31
+ end
32
+
33
+ def grab_version_string_from url
34
+ # assumes url is of form similar to http://chromedriver.storage.googleapis.com/2.3/chromedriver_mac32.zip
35
+ url.split("/")[3]
26
36
  end
27
37
  end
28
38
  end
@@ -1,5 +1,5 @@
1
1
  module Chromedriver
2
2
  class Helper
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chromedriver-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-23 00:00:00.000000000 Z
11
+ date: 2015-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.6'
55
55
  - !ruby/object:Gem::Dependency
56
- name: version_sorter
56
+ name: archive-zip
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.1'
61
+ version: 0.7.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
- version: '1.1'
68
+ version: 0.7.0
69
69
  description: Easy installation and use of chromedriver, the Chromium project's selenium
70
70
  webdriver adapter.
71
71
  email:
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.4.5
115
+ rubygems_version: 2.4.6
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: Easy installation and use of chromedriver, the Chromium project's selenium