This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
Compiling on Windows #188
Closed
Closed
Compiling on Windows #188
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0cba2f9
First compiling version on Windows. There are still some spec failures.
morenocarullo cf1de01
Cleaner handling of windows/unix difference (which command)
morenocarullo 6e41bad
The only failing specs are now related to failed MiniMagick installation
morenocarullo 93847f7
Merge remote-tracking branch 'upstream/master'
morenocarullo 4be10dc
Merge remote-tracking branch 'upstream/master'
morenocarullo 8d113f8
Merge remote-tracking branch 'upstream/master'
morenocarullo f71f698
Merge remote-tracking branch 'upstream/master'
morenocarullo 07826f7
Merge branch 'master' of https://github.com/thoughtbot/capybara-webki…
morenocarullo c7bbab9
Ignore the fork test on Windows.
morenocarullo 6e16b1e
Merge remote-tracking branch 'upstream/master'
morenocarullo 9126b45
How we can exclude specific tests on windows.
morenocarullo e14f6ee
Merge branch 'master' of https://github.com/thoughtbot/capybara-webkit
morenocarullo File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -2,16 +2,17 @@ | ||
require 'thread' | require 'thread' | ||
require 'capybara/util/timeout' | require 'capybara/util/timeout' | ||
require 'json' | require 'json' | ||
require 'rbconfig' | |||
|
|
||
class Capybara::Driver::Webkit | class Capybara::Driver::Webkit | ||
class Browser | class Browser | ||
attr :server_port | attr :server_port | ||
|
|
||
def initialize(options = {}) | def initialize(options = {}) | ||
@socket_class = options[:socket_class] || TCPSocket | @socket_class = options[:socket_class] || TCPSocket | ||
@stdout = options.has_key?(:stdout) ? | @stdout = options.has_key?(:stdout) ? | ||
options[:stdout] : | options[:stdout] : | ||
$stdout | $stdout | ||
@ignore_ssl_errors = options[:ignore_ssl_errors] | @ignore_ssl_errors = options[:ignore_ssl_errors] | ||
start_server | start_server | ||
connect | connect | ||
|
@@ -113,7 +114,7 @@ def clear_cookies | ||
end | end | ||
|
|
||
def get_cookies | def get_cookies | ||
command("GetCookies").lines.map{ |line| line.strip }.select{ |line| !line.empty? } | command("GetCookies").lines.map { |line| line.strip }.select { |line| !line.empty? } | ||
end | end | ||
|
|
||
def set_proxy(options = {}) | def set_proxy(options = {}) | ||
|
@@ -147,11 +148,19 @@ def register_shutdown_hook | ||
@owner_pid = Process.pid | @owner_pid = Process.pid | ||
at_exit do | at_exit do | ||
if Process.pid == @owner_pid | if Process.pid == @owner_pid | ||
Process.kill("INT", @pid) | kill_process(@pid) | ||
end | end | ||
end | end | ||
end | end | ||
|
|
||
def kill_process(pid) | |||
if RbConfig::CONFIG['host_os'] =~ /mingw32/ | |||
Process.kill(9, pid) | |||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for our edification, why 9 for mingw32 instead of the 2 (INT) we use elsewhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment below |
|||
else | |||
Process.kill("INT", pid) | |||
end | |||
end | |||
|
|||
def server_pipe_and_pid(server_path) | def server_pipe_and_pid(server_path) | ||
cmdline = [server_path] | cmdline = [server_path] | ||
cmdline << "--ignore-ssl-errors" if @ignore_ssl_errors | cmdline << "--ignore-ssl-errors" if @ignore_ssl_errors | ||
|
@@ -207,7 +216,7 @@ def check | ||
|
|
||
if result.nil? | if result.nil? | ||
raise WebkitNoResponseError, "No response received from the server." | raise WebkitNoResponseError, "No response received from the server." | ||
elsif result != 'ok' | elsif result != 'ok' | ||
raise WebkitInvalidResponseError, read_response | raise WebkitInvalidResponseError, read_response | ||
end | end | ||
|
|
||
|
@@ -223,10 +232,10 @@ def read_response | ||
|
|
||
def default_proxy_options | def default_proxy_options | ||
{ | { | ||
:host => "localhost", | :host => "localhost", | ||
:port => "0", | :port => "0", | ||
:user => "", | :user => "", | ||
:pass => "" | :pass => "" | ||
} | } | ||
end | end | ||
end | end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you downgrade rake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh well, I had the Rake::DSL not found problem on my machine with 0.9.2.
I then forgot to fix that before commit, now I restored 0.9.2 and merged with master.