From 33e1cac1eb99e3c6e0aea00e3631f24a7d1a9b8d Mon Sep 17 00:00:00 2001 From: pf-bajorek Date: Tue, 2 Feb 2016 18:20:30 +0100 Subject: [PATCH 1/3] Update platform.rb Fix for windows x64 machines --- lib/phantomjs/platform.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/phantomjs/platform.rb b/lib/phantomjs/platform.rb index c35f281..1de6617 100644 --- a/lib/phantomjs/platform.rb +++ b/lib/phantomjs/platform.rb @@ -138,7 +138,7 @@ def package_url class Win32 < Platform class << self def useable? - host_os.include?('mingw32') and architecture.include?('i686') + host_os.include?('mingw32') end def platform @@ -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") + rescue + end + end end end From cb7ccee110ba10c58a42aee790d3fd1104b2a1a0 Mon Sep 17 00:00:00 2001 From: pbajorek Date: Wed, 3 Feb 2016 12:34:05 +0100 Subject: [PATCH 2/3] fix windows test for path --- spec/platform_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/platform_spec.rb b/spec/platform_spec.rb index ac3fd44..11399fc 100644 --- a/spec/platform_spec.rb +++ b/spec/platform_spec.rb @@ -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 From 34986ab0f64354bc56842155399777bc2dda2842 Mon Sep 17 00:00:00 2001 From: pf-bajorek Date: Wed, 20 Jul 2016 12:35:57 +0200 Subject: [PATCH 3/3] Update platform.rb --- lib/phantomjs/platform.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/phantomjs/platform.rb b/lib/phantomjs/platform.rb index 1de6617..bb5a11e 100644 --- a/lib/phantomjs/platform.rb +++ b/lib/phantomjs/platform.rb @@ -138,7 +138,7 @@ def package_url class Win32 < Platform class << self def useable? - host_os.include?('mingw32') + !!(host_os =~ /mingw|mswin|cygwin/) end def platform @@ -158,7 +158,7 @@ def package_url end def system_phantomjs_path - `where phantomjs`.delete("\n") + `where phantomjs`.delete("\n")[0] rescue end