grell 1.6.9 → 1.6.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/grell.gemspec +7 -5
- data/lib/grell/page.rb +6 -1
- data/lib/grell/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 866f1b7117624455b79791bacba549710eb7dc2b
|
4
|
+
data.tar.gz: 4a3646c053bb7b4884fa8b82ebb24809d2d37f97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfb07e7c0a6a7fb2fe53a40a3da248a24ba683972c696ab7064481448cb4067403dc7350d34cbba21ff4f240fb09b3571adbb36b38bfecd28aeee1ea1551638e
|
7
|
+
data.tar.gz: 7f91a206fd4cb264d73b05468dce66d858637c6d675b92088b800a85b67599201f957f879d618a0f4fc7a538de79c3211f82ffc3d73b063fec760da09209578a
|
data/.travis.yml
CHANGED
@@ -6,3 +6,9 @@ rvm:
|
|
6
6
|
- 2.2.4
|
7
7
|
- 2.3.0
|
8
8
|
script: bundle exec rspec
|
9
|
+
|
10
|
+
before_install:
|
11
|
+
- mkdir travis-phantomjs
|
12
|
+
- wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
|
13
|
+
- tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs
|
14
|
+
- export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -23,7 +23,7 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
Grell uses PhantomJS, you will need to download and install it in your
|
25
25
|
system. Check for instructions in http://phantomjs.org/
|
26
|
-
Grell has been tested with PhantomJS
|
26
|
+
Grell has been tested with PhantomJS v2.1.x
|
27
27
|
|
28
28
|
## Usage
|
29
29
|
|
data/grell.gemspec
CHANGED
@@ -24,12 +24,14 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency 'capybara', '~> 2.7'
|
25
25
|
spec.add_dependency 'poltergeist', '~> 1.10'
|
26
26
|
|
27
|
-
spec.add_development_dependency
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
30
|
-
spec.add_development_dependency
|
31
|
-
spec.add_development_dependency
|
27
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
28
|
+
spec.add_development_dependency 'byebug', '~> 4.0'
|
29
|
+
spec.add_development_dependency 'kender', '~> 0.2'
|
30
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
31
|
+
spec.add_development_dependency 'webmock', '~> 1.18'
|
32
32
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
33
33
|
spec.add_development_dependency 'puffing-billy', '~> 0.5'
|
34
34
|
spec.add_development_dependency 'timecop', '~> 0.8'
|
35
|
+
spec.add_development_dependency 'capybara-webkit', '~> 1.11.1'
|
36
|
+
spec.add_development_dependency 'selenium-webdriver', '~> 2.53.4'
|
35
37
|
end
|
data/lib/grell/page.rb
CHANGED
@@ -206,7 +206,7 @@ module Grell
|
|
206
206
|
private
|
207
207
|
def all_links
|
208
208
|
links = @rawpage.all_anchors.map { |anchor| Link.new(anchor) }
|
209
|
-
body_enabled_links = links.reject { |link| link.inside_header? || link.disabled? }
|
209
|
+
body_enabled_links = links.reject { |link| link.inside_header? || link.disabled? || link.js_href? }
|
210
210
|
body_enabled_links.map { |link| link.to_url(host) }.uniq.compact
|
211
211
|
|
212
212
|
rescue Capybara::Poltergeist::ObsoleteNode
|
@@ -232,6 +232,11 @@ module Grell
|
|
232
232
|
@anchor.disabled? || !!@anchor.native.attributes['disabled']
|
233
233
|
end
|
234
234
|
|
235
|
+
# Does the href use javascript?
|
236
|
+
def js_href?
|
237
|
+
href.start_with?('javascript:')
|
238
|
+
end
|
239
|
+
|
235
240
|
# Some links may use data-href + javascript to do interesting things
|
236
241
|
def href
|
237
242
|
@anchor['href'] || @anchor['data-href']
|
data/lib/grell/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordi Polo Carres
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -150,6 +150,34 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0.8'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: capybara-webkit
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 1.11.1
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 1.11.1
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: selenium-webdriver
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 2.53.4
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 2.53.4
|
153
181
|
description: Ruby web crawler using PhantomJS
|
154
182
|
email:
|
155
183
|
- jcarres@mdsol.com
|