Class: RDoc::Readme::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/rdoc-readme/rake_task.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(src = nil, dst = nil) ⇒ RakeTask

Returns a new instance of RakeTask.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rdoc-readme/rake_task.rb', line 10

def initialize( src=nil, dst=nil )
  @name = 'rdoc:readme'
 
  desc('Generate README from RDoc')
  task @name do
    ::RDoc::Readme.new do |rdoc|
      if    src && dst
        File.open(dst, 'w').puts( rdoc.from_file(src) )
      elsif src
        puts rdoc.from_file(src)
      else
        puts rdoc.from_file_handle($stdin)
      end
    end
  end
end