From de80fc1c8c85fa079eab935f5f031466c8c39e20 Mon Sep 17 00:00:00 2001 From: geemus Date: Tue, 9 Aug 2011 11:07:53 -0500 Subject: [PATCH] [docs] alphasort doc tasks --- Rakefile | 88 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/Rakefile b/Rakefile index d55dbde92..40e66b816 100644 --- a/Rakefile +++ b/Rakefile @@ -269,50 +269,6 @@ task :docs do 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) - file_name = file_path.gsub('docs/_site/', '') - key = '' << version << '/' << file_name - Formatador.redisplay(' ' * 128) - Formatador.redisplay("Uploading [bold]#{key}[/]") - if File.extname(file_name) == '.html' - # rewrite links with version - body = File.read(file_path) - body.gsub!(/vX.Y.Z/, 'v' << version) - body.gsub!(/='\//, %{='/} << version << '/') - body.gsub!(/="\//, %{="/} << version << '/') - content_type = 'text/html' - directory.files.create( - :body => redirecter(key), - :content_type => 'text/html', - :key => 'latest/' << file_name, - :public => true - ) - else - body = File.open(file_path) - content_type = nil # leave it up to mime-types - end - directory.files.create( - :body => body, - :content_type => content_type, - :key => key, - :public => true - ) - end - Formatador.redisplay(' ' * 128) - Formatador.redisplay("Uploaded docs/_site\n") -end - task :supported_services_docs do support, shared = {}, [] for key, values in Fog.services @@ -378,6 +334,50 @@ METADATA end 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) + file_name = file_path.gsub('docs/_site/', '') + key = '' << version << '/' << file_name + Formatador.redisplay(' ' * 128) + Formatador.redisplay("Uploading [bold]#{key}[/]") + if File.extname(file_name) == '.html' + # rewrite links with version + body = File.read(file_path) + body.gsub!(/vX.Y.Z/, 'v' << version) + body.gsub!(/='\//, %{='/} << version << '/') + body.gsub!(/="\//, %{="/} << version << '/') + content_type = 'text/html' + directory.files.create( + :body => redirecter(key), + :content_type => 'text/html', + :key => 'latest/' << file_name, + :public => true + ) + else + body = File.open(file_path) + content_type = nil # leave it up to mime-types + end + directory.files.create( + :body => body, + :content_type => content_type, + :key => key, + :public => true + ) + end + Formatador.redisplay(' ' * 128) + Formatador.redisplay("Uploaded docs/_site\n") +end + task :upload_rdoc do # connect to storage provider Fog.credential = :geemus