iron-crawler 1.1.0 → 1.1.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: f6357b1e7e083df930cf9e58bee810de58908c88
4
- data.tar.gz: 7f402f09862bca26320f8af26c11b97225e00f7f
3
+ metadata.gz: 5efca3651acb88f5cf1227dd0041967defab2888
4
+ data.tar.gz: 78013e58585dda3d4571ef4c9ad8c321ecafe7b3
5
5
  SHA512:
6
- metadata.gz: 07c7fcda49f067c91a85bfc8982592d30c53af316d4415c8551b38523915ca165576a2cdd23e1923be0ad985361e5a839a360fbacc12eb0dd005b26ad68595a9
7
- data.tar.gz: 8e497245dde2de5f4e46e60362531f260808072f6b586775dfc476984a3790d2e39159b044a9c946135b5b2b0011464ad2d744af227c298f9511c5db6ac46a3c
6
+ metadata.gz: d1e75cc0ae365a95b8948d82535c869ee60f5550b41491561039b5838711c82248a11354a5351f7ed2be6bd8a3d7be3fea49299aae08ca5d35bb66ea1b1f4387
7
+ data.tar.gz: 46389122732c43f842b6785464dd9d78e9f3f9252e6dd607ab263588dc5ab06a27daa75550ed92d48bd39aaed818dbf79948572606e7a1c50b14b8b7c88e6833
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
data/iron-crawler.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: iron-crawler 1.1.0 ruby lib
5
+ # stub: iron-crawler 1.1.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "iron-crawler"
9
- s.version = "1.1.0"
9
+ s.version = "1.1.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -23,7 +23,7 @@ class Crawler < Mechanize
23
23
  puts "crawling #{link.uri}"
24
24
  begin
25
25
  page = link.click
26
- next unless Mechanize::Page === page
26
+ next unless Mechanize::Page == page
27
27
  stack.push(*src_links(page))
28
28
  stack.push(*page.links)
29
29
  rescue Mechanize::ResponseCodeError
@@ -40,7 +40,7 @@ class Crawler < Mechanize
40
40
  #
41
41
  def src_links(page)
42
42
  links = []
43
- page.search("script").each do |element|
43
+ page.search('script').each do |element|
44
44
  next if element.attributes['src'].nil?
45
45
  doc = Nokogiri::HTML::Document.new
46
46
  node = Nokogiri::XML::Node.new('foo', doc)
@@ -87,7 +87,8 @@ class Crawler < Mechanize
87
87
  # @return [Booolean] true when valid URL.
88
88
  #
89
89
  def not_valid_uri?(link)
90
- return true unless link.uri && (/^http.+/ =~ link.uri.to_s || /\/.+/ =~ link.uri.to_s)
90
+ valid_uri_regex = (/^http.+/ =~ link.uri.to_s || /\/.+/ =~ link.uri.to_s)
91
+ return true unless link.uri && valid_uri_regex
91
92
  end
92
93
 
93
94
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron-crawler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Visser