anemone 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +17 -17
- data/bin/anemone_count.rb +36 -31
- data/bin/anemone_cron.rb +107 -98
- data/bin/anemone_pagedepth.rb +43 -38
- data/bin/anemone_serialize.rb +50 -42
- data/bin/anemone_url_list.rb +54 -46
- data/bin/anemone_url_list.rb~ +58 -0
- data/lib/anemone.rb +1 -1
- data/lib/anemone/anemone.rb +36 -36
- data/lib/anemone/core.rb +181 -179
- data/lib/anemone/http.rb +36 -36
- data/lib/anemone/page.rb +184 -159
- data/lib/anemone/page_hash.rb +82 -82
- data/lib/anemone/tentacle.rb +30 -30
- metadata +10 -9
data/lib/anemone/tentacle.rb
CHANGED
@@ -1,31 +1,31 @@
|
|
1
|
-
require 'anemone/page'
|
2
|
-
|
3
|
-
module Anemone
|
4
|
-
class Tentacle
|
5
|
-
|
6
|
-
#
|
7
|
-
# Create a new Tentacle
|
8
|
-
#
|
9
|
-
def initialize(link_queue, page_queue)
|
10
|
-
@link_queue = link_queue
|
11
|
-
@page_queue = page_queue
|
12
|
-
end
|
13
|
-
|
14
|
-
#
|
15
|
-
# Gets links from @link_queue, and returns the fetched
|
16
|
-
# Page objects into @page_queue
|
17
|
-
#
|
18
|
-
def run
|
19
|
-
while true do
|
20
|
-
link = @link_queue.deq
|
21
|
-
|
22
|
-
break if link == :END
|
23
|
-
|
24
|
-
page = Page.fetch(link)
|
25
|
-
|
26
|
-
@page_queue.enq(page)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
1
|
+
require 'anemone/page'
|
2
|
+
|
3
|
+
module Anemone
|
4
|
+
class Tentacle
|
5
|
+
|
6
|
+
#
|
7
|
+
# Create a new Tentacle
|
8
|
+
#
|
9
|
+
def initialize(link_queue, page_queue)
|
10
|
+
@link_queue = link_queue
|
11
|
+
@page_queue = page_queue
|
12
|
+
end
|
13
|
+
|
14
|
+
#
|
15
|
+
# Gets links from @link_queue, and returns the fetched
|
16
|
+
# Page objects into @page_queue
|
17
|
+
#
|
18
|
+
def run
|
19
|
+
while true do
|
20
|
+
link = @link_queue.deq
|
21
|
+
|
22
|
+
break if link == :END
|
23
|
+
|
24
|
+
page = Page.fetch(link)
|
25
|
+
|
26
|
+
@page_queue.enq(page)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anemone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Kite
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-31 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -35,19 +35,20 @@ extensions: []
|
|
35
35
|
extra_rdoc_files:
|
36
36
|
- README.txt
|
37
37
|
files:
|
38
|
+
- bin/anemone_url_list.rb~
|
39
|
+
- bin/anemone_url_list.rb
|
40
|
+
- bin/anemone_serialize.rb
|
41
|
+
- bin/anemone_pagedepth.rb
|
38
42
|
- bin/anemone_count.rb
|
39
43
|
- bin/anemone_cron.rb
|
40
|
-
-
|
41
|
-
- bin/anemone_serialize.rb
|
42
|
-
- bin/anemone_url_list.rb
|
44
|
+
- lib/anemone.rb
|
43
45
|
- lib/anemone
|
44
|
-
- lib/anemone/
|
46
|
+
- lib/anemone/page.rb
|
45
47
|
- lib/anemone/core.rb
|
48
|
+
- lib/anemone/anemone.rb
|
46
49
|
- lib/anemone/http.rb
|
47
|
-
- lib/anemone/page.rb
|
48
|
-
- lib/anemone/page_hash.rb
|
49
50
|
- lib/anemone/tentacle.rb
|
50
|
-
- lib/anemone.rb
|
51
|
+
- lib/anemone/page_hash.rb
|
51
52
|
- README.txt
|
52
53
|
has_rdoc: true
|
53
54
|
homepage: http://anemone.rubyforge.org
|