Skip to content

Commit 810b358

Browse files
committed
Import www.ruby-lang.org into _import/.
1 parent a8ac8bf commit 810b358

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
_import/
12
_site/
23
.DS_Store
34
*.swp

_tasks/import.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
require 'spidr'
33
require 'fileutils'
44

5+
IMPORT_DIR = '_import'
6+
57
desc 'Spiders ruby-lang.org and imports HTML content'
68
task :import do
79
Spidr.site('http://www.ruby-lang.org/index.html') do |agent|
@@ -14,7 +16,7 @@
1416
end
1517

1618
agent.every_ok_page do |page|
17-
local_path = page.url.path[1..-1]
19+
local_path = File.join(IMPORT_DIR,page.url.path[1..-1])
1820

1921
if local_path[-1..-1] == '/'
2022
local_path += 'index.html'

0 commit comments

Comments
 (0)