Class: Reap::PublishTask

Inherits:
Task
  • Object
show all
Defined in:
lib/reap/tasks/publish-task.rb

Constant Summary

Constants inherited from Task

Task::DEFAULT_INCLUDE, Task::MUST_EXCLUDE, Task::RUBY

Instance Attribute Summary

Attributes inherited from Task

#config, #section

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Task

#[], inherited, #initialize, #package_name, registry, #ruby, #sh, tasks

Constructor Details

This class inherits a constructor from Reap::Task

Class Method Details

.descObject



8
# File 'lib/reap/tasks/publish-task.rb', line 8

def self.desc ; "Publish documents to the web." ; end

.taskObject



6
# File 'lib/reap/tasks/publish-task.rb', line 6

def self.task ; :publish ; end

Instance Method Details

#runObject



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/reap/tasks/publish-task.rb', line 18

def run
  #current_dir = Dir.pwd
  #Dir.chdir( @web_dir )
  #web_files = FileList.new
  #web_files.include('**/*')
  #web_files.exclude(*@web_exclude) if @web_exclude
  #web_files = '"' << web_files.join('" "') << '"'
  cmd = %{scp -r #{@dir}/* #{@username}@rubyforge.org:/var/www/gforge-projects/#{@project}/}
  puts "Reap is shelling out work to scp..."
  puts cmd
  sh(cmd) unless $PRETEND
end

#set(section) ⇒ Object



11
12
13
14
15
16
# File 'lib/reap/tasks/publish-task.rb', line 11

def set( section )
  @dir = section["dir"]
  #@exclude = section["exclude"]
  @project = section["project"]
  @username = section["username"]
end