Sha256: 56fa748f734182a9a06f0f017975ce8d7f28c92e5cea6fe3c76f1e124af79cd7

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

# encoding: utf-8

require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rake/clean'
require 'dropcaster'

Rake::TestTask.new(:test) do |test|
  test.libs << 'test'
  test.pattern = 'test/**/test_*.rb'
end

task :default => :test

namespace :web do
  file 'website/index.markdown' do |f|
    concat 'website/_front_matter/index.yaml', 'README.markdown', f
  end
  CLOBBER << 'website/index.markdown'

  file 'website/vision.markdown' do |f|
    concat 'website/_front_matter/vision.yaml', 'VISION.markdown', f
  end
  CLOBBER << 'website/vision.markdown'

  file 'website/contributors.markdown' do |f|
    require 'dropcaster/contributors'
    File.write('website/contributors.markdown', Dropcaster.contributors)
  end
  CLOBBER << 'website/contributors.markdown'

  file 'website/contributing.md' => 'website/contributors.markdown' do |f|
    concat 'website/_front_matter/contributing.yaml', 'CONTRIBUTING.md', f
    concat 'website/contributors.markdown', f
  end
  CLOBBER << 'website/contributing.md'

  desc "Generate web page"
  task :generate => ['website/index.markdown', 'website/vision.markdown', 'website/contributing.md'] do
    cd 'website' do
      `bundle exec jekyll build`
    end
  end
end

def concat(*files)
  File.open(files.pop.to_s, 'a') do |f|
    files.each do |src|
      f << File.read(src)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dropcaster-0.0.8 Rakefile