horsefield 0.4.63 → 0.4.64
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/horsefield/diggable.rb +6 -1
- data/lib/horsefield/digger.rb +8 -0
- data/lib/horsefield/version.rb +1 -1
- data/test/horsefield/test_scraper.rb +0 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5202566470d2206afc582ce8543261763a9c3f0c
|
4
|
+
data.tar.gz: 2a9f6554cfa9926c11573c6dde74a903c80d9e32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8695b3f5f93d82ba875b596ba7b90c2ec9de5ec817ede80af458faf8e4e02037b06fc0e86e3c360d15c04157ac06d63755c49cdba2d6e1d4ed3c2617f7b95b2c
|
7
|
+
data.tar.gz: 2e3b4cc2155abb4c74847d8248086c90c3c23ce1867730c0d9598f79ddd915ce68ca3e4b5321e15b2518a848cd287f27b18fd255a06d4abcd1a86d066e4b6e24
|
data/lib/horsefield/diggable.rb
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
module Horsefield
|
2
2
|
module Diggable
|
3
|
+
def with_fresh_fields
|
4
|
+
@fields = {}
|
5
|
+
self
|
6
|
+
end
|
7
|
+
|
3
8
|
def many(name, selector, lookup = :optional, &block)
|
4
9
|
docs = search(selector)
|
5
10
|
|
@@ -19,7 +24,7 @@ module Horsefield
|
|
19
24
|
raise MissingSelectorError, "Couldn't find required selector (#{selector})" if lookup == :required && !doc
|
20
25
|
return fields if lookup == :presence && !doc
|
21
26
|
|
22
|
-
fields.merge!(Hash[[[name, doc && doc.instance_eval(&processor(&block))]]])
|
27
|
+
fields.merge!(Hash[[[name, doc && doc.with_fresh_fields.instance_eval(&processor(&block))]]])
|
23
28
|
end
|
24
29
|
|
25
30
|
def many!(name, selector, &block)
|
data/lib/horsefield/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: horsefield
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.64
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Strömberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- horsefield.gemspec
|
97
97
|
- lib/horsefield.rb
|
98
98
|
- lib/horsefield/diggable.rb
|
99
|
+
- lib/horsefield/digger.rb
|
99
100
|
- lib/horsefield/nokogiri.rb
|
100
101
|
- lib/horsefield/scraper.rb
|
101
102
|
- lib/horsefield/version.rb
|