Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for windows x64 machines #69

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/phantomjs/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def package_url
class Win32 < Platform
class << self
def useable?
host_os.include?('mingw32') and architecture.include?('i686')
!!(host_os =~ /mingw|mswin|cygwin/)
end

def platform
Expand All @@ -156,6 +156,12 @@ def phantomjs_path
def package_url
'https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-windows.zip'
end

def system_phantomjs_path
`where phantomjs`.delete("\n")[0]
rescue
end

end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/platform_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
describe "with system install" do
before(:each) do
Phantomjs::Platform.stub(:system_phantomjs_version).and_return(Phantomjs.version)
Phantomjs::Platform.stub(:system_phantomjs_path).and_return("#{ENV['TEMP']}/path")
Phantomjs::Platform::Win32.stub(:system_phantomjs_path).and_return("#{ENV['TEMP']}/path")
end

it "returns the correct phantom js executable path for the platform" do
Expand Down