Class: UberDoc::Generate
- Defined in:
- lib/uberdoc/tasks/generate_task.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#perform ⇒ Object
should_run?.
Methods inherited from Task
Constructor Details
This class inherits a constructor from UberDoc::Task
Class Method Details
.should_run?(options) ⇒ Boolean
7 8 9 |
# File 'lib/uberdoc/tasks/generate_task.rb', line 7 def self.should_run?() .generate end |
Instance Method Details
#perform ⇒ Object
should_run?
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/uberdoc/tasks/generate_task.rb', line 11 def perform # Check if there already a doc file in this directory file_path = File.join(Dir.pwd, "UberDocMe") if File.exists?(file_path) puts "There is already an UberDocMe file in this directory" return end # Write the template file base_uberdocme = File.open(UberDoc::Util::template_file_path('UberDocMe.Base'), 'rb') { |file| file.read } File.open(file_path, 'w') {|f| f.write(base_uberdocme) } end |