selenium 0.0.1 → 0.0.2

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.
data/CHANGES CHANGED
@@ -1,7 +1,10 @@
1
1
 
2
2
  = Selenium Server Gem Changelog
3
3
 
4
- == Version 0.1.1
4
+ == Version 0.0.1
5
5
 
6
6
  * Initial release.
7
7
 
8
+ == Version 0.0.2
9
+
10
+ * Addign suppoert for windows.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -1,4 +1,9 @@
1
- require "open3"
1
+ if RUBY_PLATFORM =~ /windows/
2
+ require 'win32-open3'
3
+ else
4
+ require "open3"
5
+ end
6
+
2
7
 
3
8
  class JvmOptionsProbe
4
9
 
@@ -1,23 +1,38 @@
1
+ require 'open-uri'
2
+
1
3
  class Selenium
2
4
  def download_file_to(uri, destination_file)
3
- connection = Net::HTTP
4
-
5
- print " downloading #{uri}... "; $stdout.flush
6
- temporary_target = destination_file + ".part"
7
- FileUtils.mkdir_p(File.dirname(destination_file))
8
- File.open(temporary_target, "wb") do |write_out|
9
- write_out.print connection.get(URI.parse(uri))
10
- end
5
+ print " downloading #{uri}... "; $stdout.flush
6
+
7
+ temp = destination_file + ".part"
8
+ FileUtils.mkdir_p(File.dirname(destination_file))
9
+
10
+ File.open(temp, "wb") do |out_file|
11
+ open(uri) do |in_file|
12
+ done = false
13
+
14
+ while(!done) do
15
+ buffer = in_file.read(1024*1000)
16
+ out_file.write(buffer)
17
+
18
+ if buffer.nil? || buffer.size == 0
19
+ done = true
20
+ else
21
+ print("#"); $stdout.flush
22
+ end
23
+ end
24
+ end
25
+ end
11
26
 
12
- if File.open(temporary_target).read(200) =~ /Access Denied/
13
- puts "\n\n*** Error downloading #{uri}, got Access Denied from S3."
14
- FileUtils.rm_rf(temporary_target)
15
- exit
16
- end
27
+ if File.open(temp).read(200) =~ /Access Denied/
28
+ puts "\n\n*** Error downloading #{uri}, got Access Denied from S3."
29
+ FileUtils.rm_rf(temp)
30
+ exit
31
+ end
17
32
 
18
- FileUtils.cp(temporary_target, destination_file)
19
- FileUtils.rm_rf(temporary_target)
20
- puts "done!"
33
+ FileUtils.cp(temp, destination_file)
34
+ FileUtils.rm_rf(temp)
35
+ puts "\ndone!"
21
36
  end
22
37
 
23
38
  # unzip a .zip file into the directory it is located
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{selenium}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexander Shvets"]
12
- s.date = %q{2010-11-08}
12
+ s.date = %q{2010-11-15}
13
13
  s.default_executable = %q{selenium}
14
14
  s.description = %q{Gem wrapper for selenium server.}
15
15
  s.email = %q{alexander.shvets@gmail.com}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alexander Shvets
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-08 00:00:00 -05:00
18
+ date: 2010-11-15 00:00:00 -05:00
19
19
  default_executable: selenium
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency