selenium-prep 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.txt +1 -1
- data/lib/selenium-prep.rb +0 -3
- data/lib/selenium-prep/downloader.rb +7 -14
- data/lib/selenium-prep/system/path.rb +14 -0
- data/lib/selenium-prep/version.rb +1 -1
- data/selenium-prep.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6176d463a373a1ce2a619c2322c0808f15b0d3a2
|
4
|
+
data.tar.gz: 9425d7025dc061d4dcad3e0fc92463208d8c1ee6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdc9f137648031985fc1ee1224fd4e0274e997cdb09d5beb94bd75a334afbafa37d375d052d3a30cb95b5d494b0c9e014cd14df36ae1be10e6deebfe82b74b8e
|
7
|
+
data.tar.gz: 35f3055a944856f435d776cbc949b1d8ab3a0d761e6671c7e7140eeddc9f4cc22787ff5b1cfe55fa82c8de0fc1fdf043c9939acc1a9080e05fac411112b135cc
|
data/README.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
== DESCRIPTION:
|
4
4
|
|
5
|
-
selenium-prep helps set up your machine for local Selenium execution for multiple browsers. It downloads
|
5
|
+
selenium-prep helps set up your machine for local Selenium execution for multiple browsers. It downloads the latest browser drivers and standalone server to a specified location. It will then check your system PATH to see if the download directory is in it. If not, it will add it for you.
|
6
6
|
|
7
7
|
== INSTALLATION:
|
8
8
|
|
data/lib/selenium-prep.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative 'urls'
|
2
2
|
require_relative 'config-checker'
|
3
3
|
require 'uri'
|
4
|
-
require '
|
4
|
+
require 'rest-client'
|
5
5
|
require 'fileutils'
|
6
6
|
|
7
7
|
module SeleniumPrep
|
@@ -12,23 +12,16 @@ module SeleniumPrep
|
|
12
12
|
|
13
13
|
def download
|
14
14
|
ConfigChecker.new
|
15
|
-
|
15
|
+
|
16
16
|
urls.each do |url|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
download.write payload
|
23
|
-
end
|
24
|
-
request.on_complete do |response|
|
25
|
-
download.close
|
26
|
-
puts "[ #{Time.now} ] Finished downloading #{file}"
|
17
|
+
download_target = file_for url
|
18
|
+
File.open(download_target, 'wb') do |file|
|
19
|
+
puts "[ #{Time.now} ] Downloading #{download_target}"
|
20
|
+
file.write(RestClient.get(url))
|
21
|
+
puts "[ #{Time.now} ] Finished downloading #{download_target}"
|
27
22
|
end
|
28
|
-
hydra.queue request
|
29
23
|
end
|
30
24
|
|
31
|
-
hydra.run
|
32
25
|
end
|
33
26
|
|
34
27
|
private
|
@@ -10,6 +10,8 @@ module SeleniumPrep
|
|
10
10
|
when 'win32', 'win64'
|
11
11
|
system("set path=%path%;#{ENV['SE_DOWNLOAD_LOCATION']}")
|
12
12
|
system('reg.exe ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path /t REG_EXPAND_SZ /d %path% /f')
|
13
|
+
|
14
|
+
broadcast_windows_system_message
|
13
15
|
ENV['PATH'] = "#{ENV['PATH']};#{ENV['SE_DOWNLOAD_LOCATION']}"
|
14
16
|
when 'mac32', 'linux32', 'linux64'
|
15
17
|
unless set?
|
@@ -42,6 +44,18 @@ module SeleniumPrep
|
|
42
44
|
!`cat ~/.bash_profile | grep #{ENV['SE_DOWNLOAD_LOCATION']}`.empty?
|
43
45
|
end
|
44
46
|
|
47
|
+
def self.broadcast_windows_system_message
|
48
|
+
# See https://github.com/tourdedave/selenium-prep/issues/3 for details
|
49
|
+
require 'Win32API'
|
50
|
+
|
51
|
+
send_message_timeout = Win32API.new('user32', 'SendMessageTimeout', 'LLLPLLP', 'L')
|
52
|
+
hwnd_broadcast = 0xffff
|
53
|
+
wm_settingchange = 0x001A
|
54
|
+
smto_abortifhung = 2
|
55
|
+
result = 0
|
56
|
+
send_message_timeout.call(hwnd_broadcast, wm_settingchange, 0, 'Environment', smto_abortifhung, 5000, result)
|
57
|
+
end
|
58
|
+
|
45
59
|
end
|
46
60
|
end
|
47
61
|
end
|
data/selenium-prep.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_dependency '
|
20
|
+
spec.add_dependency 'rest-client', '~> 1.7.2'
|
21
21
|
spec.add_dependency 'rubyzip', '~> 1.1.6'
|
22
22
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
23
23
|
spec.add_development_dependency 'rake', '~> 10.0'
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium-prep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Haeffner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rest-client
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.7.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.7.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubyzip
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|