phantomjs 1.9.2.0 → 1.9.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8730b0e0d716a7241a907fc3c2e41a248764f6bb
4
- data.tar.gz: 2eb110aa0ba2d286f9f793bd4835813039f4cf99
3
+ metadata.gz: 32626604c40b862e43453c82158a2c8913942377
4
+ data.tar.gz: d3546eb7f19f1b66ba0e87e89cbba6f975265714
5
5
  SHA512:
6
- metadata.gz: 8d7909fa3988af6b45e5fbdc35e7fe29a2c5fec47ab024cd7847fcf45f4c493ca338e6eb527f6413e9795078858953c569dc32325029446dde8bba4c36506bb9
7
- data.tar.gz: d7e1696fc5980e60762e91f309661e40eab631a72e37ccf8ba10448c1ab84a17406eedbe381f6fa1a5cafeee9e0d3f6ee55d37812c1f844a80bdf9e4587f2fc3
6
+ metadata.gz: 7e7a0bec77b65db70933130fe245ae7de83d973c44b96056e79758b3c5d42133d2047abd0cfb3cd2490060c8ce64dd608b92b69555ef8ac8ca188edabddf8025
7
+ data.tar.gz: ff7b5bd58f92de836a199db35eba29167af3c3181f017ff066e098a705e67fa7539c0373a54376c594f8fcd2edd59d07895fdd98266129279de0c9afb73e2b3e
@@ -53,4 +53,5 @@ end
53
53
  require 'phantomjs/platform'
54
54
  Phantomjs.available_platforms << Phantomjs::Platform::Linux32
55
55
  Phantomjs.available_platforms << Phantomjs::Platform::Linux64
56
- Phantomjs.available_platforms << Phantomjs::Platform::OsX
56
+ Phantomjs.available_platforms << Phantomjs::Platform::OsX
57
+ Phantomjs.available_platforms << Phantomjs::Platform::Win32
@@ -9,6 +9,10 @@ module Phantomjs
9
9
  RbConfig::CONFIG['host_cpu']
10
10
  end
11
11
 
12
+ def temp_path
13
+ ENV['TMPDIR'] || ENV['TEMP'] || '/tmp'
14
+ end
15
+
12
16
  def phantomjs_path
13
17
  if system_phantomjs_installed?
14
18
  system_phantomjs_path
@@ -42,7 +46,7 @@ module Phantomjs
42
46
 
43
47
  # Purge temporary directory if it is still hanging around from previous installs,
44
48
  # then re-create it.
45
- temp_dir = File.join('/tmp', 'phantomjs_install')
49
+ temp_dir = File.join(temp_path, 'phantomjs_install')
46
50
  FileUtils.rm_rf temp_dir
47
51
  FileUtils.mkdir_p temp_dir
48
52
 
@@ -130,5 +134,29 @@ module Phantomjs
130
134
  end
131
135
  end
132
136
  end
137
+
138
+ class Win32 < Platform
139
+ class << self
140
+ def useable?
141
+ host_os.include?('mingw32') and architecture.include?('i686')
142
+ end
143
+
144
+ def platform
145
+ 'win32'
146
+ end
147
+
148
+ def phantomjs_path
149
+ if system_phantomjs_installed?
150
+ system_phantomjs_path
151
+ else
152
+ File.expand_path File.join(Phantomjs.base_dir, platform, 'phantomjs.exe')
153
+ end
154
+ end
155
+
156
+ def package_url
157
+ 'https://phantomjs.googlecode.com/files/phantomjs-1.9.2-windows.zip'
158
+ end
159
+ end
160
+ end
133
161
  end
134
162
  end
@@ -1,3 +1,3 @@
1
1
  module Phantomjs
2
- VERSION = "1.9.2.0"
2
+ VERSION = "1.9.2.1"
3
3
  end
@@ -57,6 +57,10 @@ describe Phantomjs::Platform do
57
57
  it "reports the Darwin platform as unuseable" do
58
58
  Phantomjs::Platform::OsX.should_not be_useable
59
59
  end
60
+
61
+ it "reports the Win32 Platform as unuseable" do
62
+ Phantomjs::Platform::Win32.should_not be_useable
63
+ end
60
64
  end
61
65
 
62
66
  describe "on a 32 bit linux" do
@@ -101,6 +105,10 @@ describe Phantomjs::Platform do
101
105
  it "reports the Darwin platform as unuseable" do
102
106
  Phantomjs::Platform::OsX.should_not be_useable
103
107
  end
108
+
109
+ it "reports the Win32 Platform as unuseable" do
110
+ Phantomjs::Platform::Win32.should_not be_useable
111
+ end
104
112
  end
105
113
 
106
114
  describe "on OS X" do
@@ -139,6 +147,48 @@ describe Phantomjs::Platform do
139
147
  it "reports the Linux64 platform as unuseable" do
140
148
  Phantomjs::Platform::Linux64.should_not be_useable
141
149
  end
150
+
151
+ it "reports the Win32 Platform as unuseable" do
152
+ Phantomjs::Platform::Win32.should_not be_useable
153
+ end
154
+ end
155
+
156
+ describe "on Windows" do
157
+ before do
158
+ Phantomjs::Platform.stub(:host_os).and_return('mingw32')
159
+ Phantomjs::Platform.stub(:architecture).and_return('i686')
160
+ end
161
+
162
+ describe "without system install" do
163
+ before(:each) { Phantomjs::Platform.stub(:system_phantomjs_version).and_return(nil) }
164
+
165
+ it "returns the correct phantom js executable path for the platform" do
166
+ Phantomjs.path.should =~ /win32\/phantomjs.exe$/
167
+ end
168
+ end
169
+
170
+ describe "with system install" do
171
+ before(:each) do
172
+ Phantomjs::Platform.stub(:system_phantomjs_version).and_return(Phantomjs.version)
173
+ Phantomjs::Platform.stub(:system_phantomjs_path).and_return("#{ENV['TEMP']}/path")
174
+ end
175
+
176
+ it "returns the correct phantom js executable path for the platform" do
177
+ expect(Phantomjs.path).to be == "#{ENV['TEMP']}/path"
178
+ end
179
+ end
180
+
181
+ it "reports the Darwin platform as unuseable" do
182
+ Phantomjs::Platform::OsX.should_not be_useable
183
+ end
184
+
185
+ it "reports the Linux32 Platform as unuseable" do
186
+ Phantomjs::Platform::Linux32.should_not be_useable
187
+ end
188
+
189
+ it "reports the Linux64 platform as unuseable" do
190
+ Phantomjs::Platform::Linux64.should_not be_useable
191
+ end
142
192
  end
143
193
 
144
194
  describe 'on an unknown platform' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phantomjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2.0
4
+ version: 1.9.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christoph Olszowka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-01 00:00:00.000000000 Z
11
+ date: 2013-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: poltergeist