Sha256: 8a1dd340dcd2fe55c13086def886da429384399b10c82a3a79ad4a933a46cd57

Contents?: true

Size: 1.36 KB

Versions: 12

Compression:

Stored size: 1.36 KB

Contents

namespace :doc do
  doc_repo = Pathname(ENV['DOC_REPO'] || 'gh-pages')
  doc_base = doc_repo.join('doc')
  current_git_release = -> { `git rev-parse --abbrev-ref HEAD`.chomp }
  template_option = "--template opal --template-path #{doc_repo.join('yard-templates')}"

  directory doc_repo.to_s do
    remote = ENV['DOC_REPO_REMOTE'] || '.'
    sh 'git', 'clone', '-b', 'gh-pages', '--', remote, doc_repo.to_s
  end

  task :corelib => doc_repo.to_s do
    git  = current_git_release.call
    name = 'corelib'
    glob = 'opal/**/*.rb'

    command = "doxx --template #{doc_repo.join('doxx-templates/opal.jade')} "\
              "--source opal/corelib --target #{doc_base}/#{git}/#{name} "\
              "--title \"Opal runtime.js Documentation\" --readme opal/README.md"
    puts command; system command or $stderr.puts "Please install doxx with: npm install"

    command = "yard doc #{glob} #{template_option} "\
              "--readme opal/README.md -o #{doc_base}/#{git}/#{name}"
    puts command; system command
  end

  task :stdlib => doc_repo do
    git  = current_git_release.call
    name = 'stdlib'
    glob = '{stdlib/**/*,opal/compiler,opal/erb,opal/version}.rb'
    command = "yard doc #{glob} #{template_option} "\
              "--readme stdlib/README.md -o gh-pages/doc/#{git}/#{name}"
    puts command; system command
  end
end

task :doc => ['doc:corelib', 'doc:stdlib']

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
opal-0.8.1 tasks/documenting.rake
opal-0.8.1.rc1 tasks/documenting.rake
opal-wedge-0.9.0.dev tasks/documenting.rake
opal-0.8.0 tasks/documenting.rake
opal-0.8.0.rc3 tasks/documenting.rake
opal-0.8.0.rc2 tasks/documenting.rake
opal-0.8.0.rc1 tasks/documenting.rake
opal-0.8.0.beta1 tasks/documenting.rake
opal-0.7.2 tasks/documenting.rake
opal-0.7.1 tasks/documenting.rake
opal-0.7.0 tasks/documenting.rake
opal-0.7.0.rc1 tasks/documenting.rake