Sha256: 9d5de6a57536ed0c293c65a9ff62c5d5a232817ed057e916b7ea6ebe7b9c0258

Contents?: true

Size: 1.28 KB

Versions: 16

Compression:

Stored size: 1.28 KB

Contents

require 'yaml'

def website_config
  unless @website_config
    begin
      @website_config = YAML.load(File.read("config/website.yml"))
    rescue
      puts <<-EOS
To upload your website to a host, you need to configure
config/website.yml. See config/website.yml.sample for 
an example.
EOS
      exit
    end
  end
  @website_config
end

desc 'Generate website files'
task :website_generate => :ruby_env do
  (Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
    sh %{ #{RUBY_APP} script/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
  end
end

desc 'Upload website files to rubyforge'
task :website_upload do
  local_dir  = 'website'
  host       = website_config["host"]
  host       = host ? "#{host}:" : ""
  remote_dir = website_config["remote_dir"]
  sh %{rsync -aCv #{local_dir}/ #{host}#{remote_dir}}
end

remove_task :publish_docs # recreate hoe's rubyforge specific version

desc 'Publish RDoc to RubyForge.'
task :publish_docs => [:clean, :docs] do
  local_dir  = 'doc'
  host       = website_config["host"]
  host       = host ? "#{host}:" : ""
  remote_dir = File.join(website_config["remote_dir"], "doc")
  sh %{rsync -aCv #{local_dir}/ #{host}#{remote_dir}}
end

desc 'Generate and upload website files'
task :website => [:website_generate, :website_upload, :publish_docs]

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
newgem-1.0.0 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.0.1 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.0.2 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.0.3 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.0.4 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.0.5 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.0.6 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.0.7 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.1.0 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.2.0 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.2.1 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.2.2 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.2.3 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.3.0 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.4.0 newgem_generators/install_website/templates/tasks/website.rake
newgem-1.4.1 newgem_generators/install_website/templates/tasks/website.rake