phantomjs 1.9.7.0 → 1.9.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/README.md +31 -36
- data/lib/phantomjs/platform.rb +5 -5
- data/lib/phantomjs/version.rb +1 -1
- data/phantomjs.gemspec +1 -0
- metadata +32 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c560ed1497811063f421e1467840a1918321cac
|
4
|
+
data.tar.gz: ee0d09837e8863c23b4feff85b76ad55fa83882c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c38be07431a39521e23299bf26b7e38204f4f909589405cb08ac5ba5d163bc3fd4100d880a68881d2f758f9fd9791dae80f346ef099d889c7854bb303bb29c5b
|
7
|
+
data.tar.gz: 30384ae6f872cea83011587634d234ced6d9fb07ff05234781f933c857bead4e11fbef6a08b77248e3b3a1c32b6b70bb2cc1658388245e8d5260420652287195
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,73 +1,68 @@
|
|
1
|
-
#
|
1
|
+
# PhantomJS as a RubyGem
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/colszowka/phantomjs-gem.png?branch=master)](https://travis-ci.org/colszowka/phantomjs-gem)
|
4
4
|
|
5
5
|
**DISCLAIMER: Alpha status, YMMV!**
|
6
6
|
|
7
|
-
I am lazy as hell, and wanted to be able to install [PhantomJS](http://phantomjs.org) via Rubygems/Bundler
|
8
|
-
when using [poltergeist](https://github.com/jonleighton/poltergeist).
|
7
|
+
I am lazy as hell, and wanted to be able to install [PhantomJS](http://phantomjs.org) via Rubygems/Bundler when using [poltergeist](https://github.com/jonleighton/poltergeist).
|
9
8
|
|
10
|
-
It keeps installations of phantomjs in `$HOME/.phantomjs/VERSION/PLATFORM`. When you call `Phantomjs.path`, it
|
11
|
-
will return the path to the phantomjs executable in there. If that is not present, it will first fetch and
|
9
|
+
It keeps installations of phantomjs in `$HOME/.phantomjs/VERSION/PLATFORM`. When you call `Phantomjs.path`, it will return the path to the phantomjs executable in there. If that is not present, it will first fetch and
|
12
10
|
install the prebuilt packages suitable for the current plattform (currently Linux 32/64 or OS X supported).
|
13
11
|
|
14
|
-
If there is a phantomjs executable in your `$PATH` that matches the version number packaged in this gem, this one
|
15
|
-
will be used instead of installing one in your `$HOME/.phantomjs`.
|
12
|
+
If there is a phantomjs executable in your `$PATH` that matches the version number packaged in this gem, this one will be used instead of installing one in your `$HOME/.phantomjs`.
|
16
13
|
|
17
|
-
You will need `cURL` or `wget` on your system. For extraction, `bunzip2` and `tar` are required on Linux, and `unzip`
|
18
|
-
on OS X. They should be installed already.
|
14
|
+
You will need `cURL` or `wget` on your system. For extraction, `bunzip2` and `tar` are required on Linux, and `unzip` on OS X. They should be installed already.
|
19
15
|
|
20
16
|
**TL;DR:** Instead of manually installing phantomjs on your machines, use this gem. It will take care of it.
|
21
17
|
|
22
18
|
## Example
|
23
19
|
|
24
|
-
|
25
|
-
|
20
|
+
```ruby
|
21
|
+
require 'phantomjs'
|
22
|
+
Phantomjs.path # => path to a phantom js executable suitable to your current platform. Will install before return when not installed yet.
|
26
23
|
|
27
|
-
|
28
|
-
|
24
|
+
# Or run phantomjs with the passed arguments:
|
25
|
+
Phantomjs.run('./path/to/script.js') # => returns stdout
|
29
26
|
|
30
|
-
|
31
|
-
|
27
|
+
# Also takes a block to receive each line of output:
|
28
|
+
Phantomjs.run('./path/to/script.js') { |line| puts line }
|
29
|
+
```
|
32
30
|
|
33
31
|
## Usage with Poltergeist/Capybara
|
34
32
|
|
35
33
|
Add this to your `Gemfile`:
|
36
34
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
35
|
+
```ruby
|
36
|
+
group :test do
|
37
|
+
gem 'poltergeist'
|
38
|
+
gem 'phantomjs', :require => 'phantomjs/poltergeist'
|
39
|
+
end
|
40
|
+
```
|
41
41
|
|
42
|
-
This will automatically require (and install) phantomjs and configure Capybara in the same way as noted below for
|
43
|
-
manual setup.
|
42
|
+
This will automatically require (and install) phantomjs and configure Capybara in the same way as noted below for manual setup.
|
44
43
|
|
45
|
-
Note that you need to add poltergeist as a dependency explicitly since it is not a dependency of this gem in order
|
46
|
-
to avoid forcing users to install poltergeist if the just want to use phantomjs itself.
|
44
|
+
Note that you need to add poltergeist as a dependency explicitly since it is not a dependency of this gem in order to avoid forcing users to install poltergeist if the just want to use phantomjs itself.
|
47
45
|
|
48
46
|
### Manual setup
|
49
47
|
|
50
|
-
Add `gem 'phantomjs', :group => :test` to your `Gemfile` and run `bundle`. In your test/spec helper, re-configure
|
51
|
-
the Poltergeist capybara driver to use the phantomjs package from this gem:
|
48
|
+
Add `gem 'phantomjs', :group => :test` to your `Gemfile` and run `bundle`. In your test/spec helper, re-configure the Poltergeist capybara driver to use the phantomjs package from this gem:
|
52
49
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
50
|
+
```ruby
|
51
|
+
require 'phantomjs' # <-- Not required if your app does Bundler.require automatically (e.g. when using Rails)
|
52
|
+
Capybara.register_driver :poltergeist do |app|
|
53
|
+
Capybara::Poltergeist::Driver.new(app, :phantomjs => Phantomjs.path)
|
54
|
+
end
|
55
|
+
```
|
57
56
|
|
58
57
|
Check out [the poltergeist docs](https://www.ruby-toolbox.com/gems/phantomjs) for all the options you can pass in there.
|
59
58
|
|
60
59
|
## A note about versions.
|
61
60
|
|
62
|
-
The gem version consists of 4 digits: The first 3 indicate the phantomjs release installed via this gem,
|
63
|
-
the last one is the internal version of this gem, in case I screw things up and need to push another release
|
64
|
-
before
|
61
|
+
The gem version consists of 4 digits: The first 3 indicate the phantomjs release installed via this gem, the last one is the internal version of this gem, in case I screw things up and need to push another release in the interim.
|
65
62
|
|
66
63
|
## Contributing
|
67
64
|
|
68
|
-
**Warning**: The `spec_helper` calls `Phantomjs.implode` when it is loaded, which purges the `~/.phantomjs`
|
69
|
-
directory. This is no bad thing, it just means every time you run the specs you'll download and install all
|
70
|
-
three packages over, so tread with caution please :)
|
65
|
+
**Warning**: The `spec_helper` calls `Phantomjs.implode` when it is loaded, which purges the `~/.phantomjs` directory. This is no bad thing, it just means every time you run the specs you'll download and install all three packages over, so tread with caution please. :)
|
71
66
|
|
72
67
|
1. Fork it
|
73
68
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
@@ -77,7 +72,7 @@ three packages over, so tread with caution please :)
|
|
77
72
|
|
78
73
|
## Copyright
|
79
74
|
|
80
|
-
(c) 2013 Christoph Olszowka
|
75
|
+
(c) 2013-2014 Christoph Olszowka
|
81
76
|
|
82
77
|
Note that this project merely simplifies the installation of the entirely separate PhantomJS project
|
83
78
|
via a Ruby gem. You can find the license information for PhantomJS at http://phantomjs.org/
|
data/lib/phantomjs/platform.rb
CHANGED
@@ -51,7 +51,7 @@ module Phantomjs
|
|
51
51
|
FileUtils.mkdir_p temp_dir
|
52
52
|
|
53
53
|
Dir.chdir temp_dir do
|
54
|
-
unless system "curl -O #{package_url}" or system "wget #{package_url}"
|
54
|
+
unless system "curl -L -O #{package_url}" or system "wget #{package_url}"
|
55
55
|
raise "\n\nFailed to load phantomjs! :(\nYou need to have cURL or wget installed on your system.\nIf you have, the source of phantomjs might be unavailable: #{package_url}\n\n"
|
56
56
|
end
|
57
57
|
|
@@ -98,7 +98,7 @@ module Phantomjs
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def package_url
|
101
|
-
'
|
101
|
+
'https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2'
|
102
102
|
end
|
103
103
|
end
|
104
104
|
end
|
@@ -114,7 +114,7 @@ module Phantomjs
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def package_url
|
117
|
-
'
|
117
|
+
'https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-i686.tar.bz2'
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
@@ -130,7 +130,7 @@ module Phantomjs
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def package_url
|
133
|
-
'
|
133
|
+
'https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-macosx.zip'
|
134
134
|
end
|
135
135
|
end
|
136
136
|
end
|
@@ -154,7 +154,7 @@ module Phantomjs
|
|
154
154
|
end
|
155
155
|
|
156
156
|
def package_url
|
157
|
-
'
|
157
|
+
'https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-windows.zip'
|
158
158
|
end
|
159
159
|
end
|
160
160
|
end
|
data/lib/phantomjs/version.rb
CHANGED
data/phantomjs.gemspec
CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.license = 'MIT'
|
11
11
|
|
12
12
|
gem.add_development_dependency 'poltergeist'
|
13
|
+
gem.add_development_dependency 'capybara', '~> 2.0.0'
|
13
14
|
gem.add_development_dependency 'rspec', ">= 2.11.0"
|
14
15
|
gem.add_development_dependency 'simplecov'
|
15
16
|
gem.add_development_dependency 'rake'
|
metadata
CHANGED
@@ -1,69 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phantomjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.7.
|
4
|
+
version: 1.9.7.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: 2014-
|
11
|
+
date: 2014-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: poltergeist
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: capybara
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.0.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.0.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rspec
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- -
|
45
|
+
- - ">="
|
32
46
|
- !ruby/object:Gem::Version
|
33
47
|
version: 2.11.0
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- -
|
52
|
+
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: 2.11.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: simplecov
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- -
|
59
|
+
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
61
|
version: '0'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- -
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- -
|
73
|
+
- - ">="
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: '0'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- -
|
80
|
+
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
69
83
|
description: Auto-install phantomjs on demand for current platform. Comes with poltergeist
|
@@ -74,10 +88,10 @@ executables: []
|
|
74
88
|
extensions: []
|
75
89
|
extra_rdoc_files: []
|
76
90
|
files:
|
77
|
-
- .gitignore
|
78
|
-
- .rspec
|
79
|
-
- .simplecov
|
80
|
-
- .travis.yml
|
91
|
+
- ".gitignore"
|
92
|
+
- ".rspec"
|
93
|
+
- ".simplecov"
|
94
|
+
- ".travis.yml"
|
81
95
|
- Gemfile
|
82
96
|
- LICENSE
|
83
97
|
- README.md
|
@@ -101,17 +115,17 @@ require_paths:
|
|
101
115
|
- lib
|
102
116
|
required_ruby_version: !ruby/object:Gem::Requirement
|
103
117
|
requirements:
|
104
|
-
- -
|
118
|
+
- - ">="
|
105
119
|
- !ruby/object:Gem::Version
|
106
120
|
version: '0'
|
107
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
122
|
requirements:
|
109
|
-
- -
|
123
|
+
- - ">="
|
110
124
|
- !ruby/object:Gem::Version
|
111
125
|
version: '0'
|
112
126
|
requirements: []
|
113
127
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.2.2
|
115
129
|
signing_key:
|
116
130
|
specification_version: 4
|
117
131
|
summary: Auto-install phantomjs on demand for current platform. Comes with poltergeist
|
@@ -121,3 +135,4 @@ test_files:
|
|
121
135
|
- spec/platform_spec.rb
|
122
136
|
- spec/runner.js
|
123
137
|
- spec/spec_helper.rb
|
138
|
+
has_rdoc:
|