Sha256: 481274b0e46f7182b3f43e47499e437e3194a60e011f7b06a56f064c43656ecf

Contents?: true

Size: 1.13 KB

Versions: 7

Compression:

Stored size: 1.13 KB

Contents

# -*- coding: utf-8 -*-


require 'xot/rake'


module Rucy


  module Rake


    def rdoc ()
      env :RDOC, 'rdoc'# 'yardoc'
    end

    def rucy2rdoc ()
      env :RUCY2RDOC, 'rucy2rdoc'
    end

    def generate_documents ()
      rdocdir = ".doc/#{ext_dir}"
      srcs    = FileList["#{ext_dir}/**/*.{#{src_exts.join ','}}"]
      rdocs   = Hash[srcs.map{|path| [path, "#{rdocdir}/#{File.basename path}"]}]
      out     = "#{doc_dir}/index.html"

      alias_task :doc   => out
      alias_task :clean => 'doc:clean'

      namespace :doc do
        desc "build documents"
        file out => rdocs.values do
          sh %( #{rdoc} #{rdocs.values.join ' '} )
        end

        rdocs.each do |(src, rdoc)|
          file rdoc => [src, rdocdir] do
            sh %( #{rucy2rdoc} #{src} > #{rdoc} )
          end
        end

        directory rdocdir

        task :clean do
          sh %( rm -rf #{rdocdir} #{rdocs.values.join ' '} )
        end
      end
    end


  end# Rake


end# Rucy


include Rucy::Rake


File.expand_path('../../bin', __dir__).tap do |path|
  ENV['PATH'] += ":#{path}" unless ENV['PATH'].split(':').include?(path)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rucy-0.1.21 lib/rucy/rake.rb
rucy-0.1.20 lib/rucy/rake.rb
rucy-0.1.18 lib/rucy/rake.rb
rucy-0.1.16 lib/rucy/rake.rb
rucy-0.1.15 lib/rucy/rake.rb
rucy-0.1.14 lib/rucy/rake.rb
rucy-0.1.13 lib/rucy/rake.rb