Skip to content

Commit eae5cdd

Browse files
committed
Remove obsolete rake task to update timestamps
1 parent ad076c0 commit eae5cdd

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

Rakefile

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
require 'fileutils'
33
require 'open-uri'
44
require 'rss'
5-
require 'net/ftp'
65

76
gem 'spidr', '~> 0.4'
87
require 'spidr'
@@ -15,9 +14,6 @@ OUTPUT_DIR = '_import'
1514
LANGUAGES = %w[bg de en es fr id it ja ko pl pt tr zh_TW zh_cn]
1615
TIMEZONE = 'UTC'
1716

18-
TIMESTAMP_STABLE = '_includes/timestamp_stable'
19-
TIMESTAMP_NIGHTLY = '_includes/timestamp_nightly'
20-
2117

2218
def url_to_path(url)
2319
local_path = File.join(OUTPUT_DIR,url.path[1..-1])
@@ -298,41 +294,6 @@ end
298294
desc "Imports #{HOST}"
299295
task :import => ['import:pages', 'import:news']
300296

301-
desc "Update timestamps of nightly and stable snapshots"
302-
task :update_timestamps do
303-
304-
domain = 'ruby-lang.org'
305-
nightly_fn = '/pub/ruby/snapshot.tar.gz'
306-
stable_fn = '/pub/ruby/stable-snapshot.tar.gz'
307-
308-
nightly_timestamp, stable_timestamp = nil, nil
309-
nightly_mtime, stable_mtime = nil, nil
310-
311-
begin
312-
warn "Retrieving timestamps from #{domain}..."
313-
Net::FTP.open(domain) do |ftp|
314-
ftp.login
315-
nightly_mtime = ftp.mtime(nightly_fn)
316-
stable_mtime = ftp.mtime(stable_fn)
317-
end
318-
rescue
319-
warn "Unable to retrieve timestamps"
320-
else
321-
timezone = 9 # JST
322-
nightly_timestamp = (nightly_mtime + timezone * 3600).strftime('%Y/%m/%d %H:%M:%S')
323-
stable_timestamp = (stable_mtime + timezone * 3600).strftime('%Y/%m/%d %H:%M:%S')
324-
end
325-
326-
if nightly_timestamp
327-
puts 'Writing timestamp for nightly snapshot...'
328-
File.open(TIMESTAMP_NIGHTLY, 'w') {|f| f.print nightly_timestamp }
329-
end
330-
if stable_timestamp
331-
puts 'Writing timestamp for stable snapshot...'
332-
File.open(TIMESTAMP_STABLE, 'w') {|f| f.print stable_timestamp }
333-
end
334-
end
335-
336297
desc "Generates the Jekyll site"
337298
task :generate do
338299
require 'jekyll'

0 commit comments

Comments
 (0)