selenium-prep 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa3a1f4b9de0019d2a5ccf4665f381334314e1a5
4
- data.tar.gz: ccd0dc7e1a75cab075fe973e524278df0c1a0cd6
3
+ metadata.gz: 6176d463a373a1ce2a619c2322c0808f15b0d3a2
4
+ data.tar.gz: 9425d7025dc061d4dcad3e0fc92463208d8c1ee6
5
5
  SHA512:
6
- metadata.gz: 6dbf642956127fe2c9ffe88015fe926a3b2812c12cb7c73311c7cb629c7e3ca268c59c873c59aebfbc11275c46a70d263973914866f3831ea07bd9a8e246bbfa
7
- data.tar.gz: 7b9010f011b40f090e25bb16938a81e372cf044c8f27b474f0be3be37cd7d68ff0ac876007df95aa468d4bd96c6576666e27eef9ec52c4430485c9d643877993
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 (in parallel) 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.
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
@@ -34,7 +34,4 @@ module SeleniumPrep
34
34
  result
35
35
  end
36
36
 
37
- private
38
-
39
-
40
37
  end
@@ -1,7 +1,7 @@
1
1
  require_relative 'urls'
2
2
  require_relative 'config-checker'
3
3
  require 'uri'
4
- require 'typhoeus'
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
- hydra = Typhoeus::Hydra.new(max_concurrency: 3)
15
+
16
16
  urls.each do |url|
17
- file = file_for url
18
- download = File.open(file, 'wb')
19
- puts "[ #{Time.now} ] Downloading #{file}"
20
- request = Typhoeus::Request.new url
21
- request.on_body do |payload|
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
@@ -1,3 +1,3 @@
1
1
  module SeleniumPrep
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -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 'typhoeus', '~> 0.6.9'
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.0
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-10-30 00:00:00.000000000 Z
11
+ date: 2014-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: typhoeus
14
+ name: rest-client
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.6.9
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: 0.6.9
26
+ version: 1.7.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubyzip
29
29
  requirement: !ruby/object:Gem::Requirement