Sha256: 53699d1ce9f98ec23adf973363dab41d2e8f8878e32820b2fb830bf3275848ab

Contents?: true

Size: 471 Bytes

Versions: 1

Compression:

Stored size: 471 Bytes

Contents

require 'rake/tasklib'

module Albacore
	class RenameTask < Rake::TaskLib
		attr_accessor :name
		attr_accessor :actual_name, :target_name
		
		def initialize(name=:rename, &block)
			@name = name
			@block = block
			define
		end
		
		def define
			task name do
				@block.call(self) unless @block.nil?
				if (@actual_name.nil? || @target_name.nil?)
					fail
				else
					File.rename(@actual_name, @target_name)
				end
			end
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
albacore-0.0.7 lib/rake/renametask.rb