horsefield 0.2.0 → 0.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: 2b3b807333e7816d8c27293ffdca57a22d418c8a
4
- data.tar.gz: 47c87f69a1b0cb1730b8f62f55989fc6cf0c084f
3
+ metadata.gz: 5676901f54d7891d4cec8b90b1a1a1db2db8a0df
4
+ data.tar.gz: 5097cc4fb72fced2679c9e7da8afcaee6eade1c0
5
5
  SHA512:
6
- metadata.gz: 959464294c91f2e468cc6fb0f5f48d0ca9c02c4cc54b66de41d04cfab238f5906b6dd8dbce5a7f79fb33c18566054820494628b45a0513e91051dd67a0460026
7
- data.tar.gz: 769c0fb02d9e75f29da9d8df95dd7d84bf7e7c9436b71c2c0c9ac834bb3cd62e72eb4fbbcafa4f2d65e5d90a69135674cec48eb36029eb9286eabd72fd0cb1c8
6
+ metadata.gz: 58e5d273cb209dbb0c88b2e9dd8e13096c8c3fcaf758b16b694d33242f55532e166e9a6f18b17ef718c88ee02eac8a07368b415c70f8fffffc242b234a6abeed
7
+ data.tar.gz: ae3e297e9ae56f5f7b67f8e18ef0585c738621b90deb6ff56fe5d86025479193966d52fe6f5f97a165b58119965fd767813dc3420f215988c5cda68d35a1b400
data/README.md CHANGED
@@ -18,7 +18,7 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- Horsefield::Scraper.new('http://jobb.monster.se/jobb/?q=ruby&cy=se').scrape do
21
+ Horsefield.scrape 'http://jobb.monster.se/jobb/?q=ruby&cy=se' do
22
22
  many :jobs, '.listingsTable .odd, .listingsTable .even' do
23
23
  one :title, '.jobTitleContainer'
24
24
  one :company, '.companyContainer'
data/lib/horsefield.rb CHANGED
@@ -2,5 +2,7 @@ require "horsefield/version"
2
2
  require 'horsefield/scraper'
3
3
 
4
4
  module Horsefield
5
- # Your code goes here...
5
+ def self.scrape(url = nil, html: nil, &block)
6
+ Horsefield::Scraper.new.scrape(url, html: html, &block)
7
+ end
6
8
  end
@@ -1,3 +1,3 @@
1
1
  module Horsefield
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -1,4 +1,11 @@
1
1
  require 'horsefield'
2
2
 
3
3
  describe Horsefield do
4
+ it 'should delegate to Scraper' do
5
+ result = Horsefield.scrape 'http://example.org' do
6
+ one :headline, 'h1'
7
+ end
8
+
9
+ result[:headline].should == 'Example Domain'
10
+ end
4
11
  end
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.2.0
4
+ version: 0.2.1
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: 2013-08-26 00:00:00.000000000 Z
11
+ date: 2013-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize