unbreakable 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/unbreakable.rb +1 -1
- data/lib/unbreakable/scraper.rb +8 -8
- data/lib/unbreakable/version.rb +1 -1
- data/unbreakable.gemspec +1 -1
- metadata +8 -8
data/lib/unbreakable.rb
CHANGED
data/lib/unbreakable/scraper.rb
CHANGED
@@ -10,12 +10,12 @@ module Unbreakable
|
|
10
10
|
# require 'open-uri'
|
11
11
|
# class MyScraper < Unbreakable::Scraper
|
12
12
|
# # Stores the contents of +http://www.example.com/+ in +index.html+.
|
13
|
-
# def retrieve(
|
13
|
+
# def retrieve(args)
|
14
14
|
# store(:path => 'index.html'){ open('http://www.example.com/').read }
|
15
15
|
# end
|
16
16
|
#
|
17
17
|
# # Processes +index.html+.
|
18
|
-
# def process(
|
18
|
+
# def process(args)
|
19
19
|
# fetch('index.html').process(:transform).apply
|
20
20
|
# end
|
21
21
|
#
|
@@ -96,9 +96,9 @@ The most commonly used commands are:
|
|
96
96
|
command = args.shift
|
97
97
|
case command
|
98
98
|
when 'retrieve'
|
99
|
-
retrieve(
|
99
|
+
retrieve(args)
|
100
100
|
when 'process'
|
101
|
-
process(
|
101
|
+
process(args)
|
102
102
|
when 'config'
|
103
103
|
print_configuration @app
|
104
104
|
when nil
|
@@ -148,14 +148,14 @@ The most commonly used commands are:
|
|
148
148
|
end
|
149
149
|
|
150
150
|
# Caches remote files to the datastore for later processing.
|
151
|
-
# @param [Array] args
|
152
|
-
def retrieve(
|
151
|
+
# @param [Array] args command-line arguments
|
152
|
+
def retrieve(args)
|
153
153
|
raise NotImplementedError
|
154
154
|
end
|
155
155
|
|
156
156
|
# Processes cached files into machine-readable data.
|
157
|
-
# @param [Array] args
|
158
|
-
def process(
|
157
|
+
# @param [Array] args command-line arguments
|
158
|
+
def process(args)
|
159
159
|
processable.each do |record|
|
160
160
|
fetch(record).process(:transform, :args => args).apply
|
161
161
|
end
|
data/lib/unbreakable/version.rb
CHANGED
data/unbreakable.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.authors = ["Open North"]
|
10
10
|
s.email = ["info@opennorth.ca"]
|
11
11
|
s.homepage = "http://github.com/opennorth/unbreakable"
|
12
|
-
s.summary = %q{Make your scrapers unbreakable
|
12
|
+
s.summary = %q{Make your scrapers unbreakable}
|
13
13
|
s.description = %q{Abstracts and bulletproofs common scraping tasks.}
|
14
14
|
|
15
15
|
s.rubyforge_project = "unbreakable"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unbreakable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-09-08 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &70251392277560 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70251392277560
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: dragonfly
|
27
|
-
requirement: &
|
27
|
+
requirement: &70251392277060 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.9.5
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70251392277060
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70251392276600 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 2.6.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70251392276600
|
47
47
|
description: Abstracts and bulletproofs common scraping tasks.
|
48
48
|
email:
|
49
49
|
- info@opennorth.ca
|
@@ -92,7 +92,7 @@ rubyforge_project: unbreakable
|
|
92
92
|
rubygems_version: 1.8.6
|
93
93
|
signing_key:
|
94
94
|
specification_version: 3
|
95
|
-
summary: Make your scrapers unbreakable
|
95
|
+
summary: Make your scrapers unbreakable
|
96
96
|
test_files:
|
97
97
|
- spec/spec.opts
|
98
98
|
- spec/spec_helper.rb
|