1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[misc] separate fog.io and rdoc tasks

This commit is contained in:
geemus 2011-05-27 11:26:16 -07:00
parent 91ededb495
commit f4f9b05cc1

View file

@ -227,14 +227,29 @@ task :changelog do
end
task :docs do
# build the docs locally
sh "jekyll docs docs/_site"
Rake::Task[:upload_fog_io].invoke
Rake::Task[:upload_rdoc].invoke
# write base index with redirect to new version
directory.files.create(
:body => redirecter('latest'),
:content_type => 'text/html',
:key => 'index.html',
:public => true
)
Formatador.display_line
end
task :upload_fog_io do
# connect to storage provider
Fog.credential = :geemus
storage = Fog::Storage.new(:provider => 'AWS')
directory = storage.directories.new(:key => 'fog.io')
# build the docs locally
sh "jekyll docs docs/_site"
# write web page files to versioned 'folder'
for file_path in Dir.glob('docs/_site/**/*')
next if File.directory?(file_path)
@ -267,7 +282,14 @@ task :docs do
)
end
Formatador.redisplay(' ' * 128)
Formatador.redisplay('Uploaded docs/_site')
Formatador.redisplay("Uploaded docs/_site\n")
end
task :upload_rdoc do
# connect to storage provider
Fog.credential = :geemus
storage = Fog::Storage.new(:provider => 'AWS')
directory = storage.directories.new(:key => 'fog.io')
# write rdoc files to versioned 'folder'
Rake::Task[:rdoc].invoke
@ -290,17 +312,7 @@ task :docs do
:key => 'latest/rdoc/index.html',
:public => true
)
Formatador.redisplay('Uploaded rdoc')
# write base index with redirect to new version
directory.files.create(
:body => redirecter('latest'),
:content_type => 'text/html',
:key => 'index.html',
:public => true
)
Formatador.display_line
Formatador.redisplay("Uploaded rdoc\n")
end
def redirecter(path)