Sha256: ff4f217f7d4849ce5f620ca0e0604ca8ab75161a8e000c2fa87721a541eb4916

Contents?: true

Size: 877 Bytes

Versions: 3

Compression:

Stored size: 877 Bytes

Contents

require 'reap/task'

#
# Web Publish Task
#
class Reap::WebPublish < Reap::Task

  section_required true

  def task_desc
    "publish project website to your internet host *"
  end

  attr_accessor :host, :type, :dir, :project, :username
  attr_accessor :exclude  # not using yet

  def init
    @host     ||= 'rubyforge.org'
    @project  ||= master['rubyforge']['project'] || master['name']
    @username ||= master['rubyforge']['username']
    @exclude  ||= []
  end

  def run
    cmd = ''; skip = false

    case @host
    when 'rubyforge'
      cmd = %{scp -r #{@dir}/* #{@username}@rubyforge.org:/var/www/gforge-projects/#{@project}/}
    else
      puts %{Unrecognized publishing host '#{@host}'. Skipped.}
      skip = true
    end

    unless skip
      puts "Reap is shelling out publishing work..."
      puts cmd
      sh(cmd) unless $PRETEND
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reap-4.0 lib/reap/task/webpublish.rb
reap-4.0.0 lib/reap/task/webpublish.rb
reap-5.10.10 lib/reap/task/webpublish.rb