lib/phantomjs/platform.rb in phantomjs2-2.0.0.1 vs lib/phantomjs/platform.rb in phantomjs2-2.0.0.2

- old
+ new

@@ -66,13 +66,21 @@ end # Find the phantomjs build we just extracted extracted_dir = Dir['phantomjs*'].find { |path| File.directory?(path) } - # Move the extracted phantomjs build to $HOME/.phantomjs/version/platform - if FileUtils.mv extracted_dir, File.join(Phantomjs.base_dir, platform) - STDOUT.puts "\nSuccessfully installed phantomjs. Yay!" + if extracted_dir.nil? + # Move the executable file + FileUtils.mkdir_p File.join(Phantomjs.base_dir, platform, 'bin') + if FileUtils.mv 'phantomjs', File.join(Phantomjs.base_dir, platform, 'bin') + STDOUT.puts "\nSuccessfully installed phantomjs. Yay!" + end + else + # Move the extracted phantomjs build to $HOME/.phantomjs/version/platform + if FileUtils.mv extracted_dir, File.join(Phantomjs.base_dir, platform) + STDOUT.puts "\nSuccessfully installed phantomjs. Yay!" + end end # Clean up remaining files in tmp if FileUtils.rm_rf temp_dir STDOUT.puts 'Removed temporarily downloaded files.' @@ -108,11 +116,11 @@ def platform 'x86_64-linux' end def package_url - 'https://github.com/bprodoehl/phantomjs/releases/download/v2.0.0-20150528/phantomjs-2.0.0-20150528-u1404-x86_64.zip' + 'https://github.com/eugene1g/phantomjs/releases/download/2.0.0-bin/phantomjs-2.0.0-ubuntu_x86_64.zip' end end end class Linux32 < Platform @@ -140,10 +148,10 @@ def platform 'darwin' end def package_url - 'https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.0.0-macosx.zip' + 'https://github.com/eugene1g/phantomjs/releases/download/2.0.0-bin/phantomjs-2.0.0-macosx.zip' end end end class Win32 < Platform