Sha256: 61fb092281e1d92de4a3f7fce2e87d32a6b2a9dada01f43981a482d01f5c88d4

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

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

RuboCop::RakeTask.new

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

task default: %i[rubocop 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
    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

2 entries across 2 versions & 1 rubygems

Version Path
dropcaster-1.2.0 Rakefile
dropcaster-1.1.0 Rakefile