Sha256: f23a7c043f0145b7c0a19e3318de1187e276259b036cc59002db885df9210d2c

Contents?: true

Size: 1.21 KB

Versions: 11

Compression:

Stored size: 1.21 KB

Contents

require 'albacore/albacoretask'

class VssGet
  TaskName = :vssget
  include Albacore::Task
  include Albacore::RunCommand

  attr_accessor :repository, :project, :path, :username, :password, :recursive, :readonly, :quite
  attr_array :options

  def initialize(command=nil)
    @options=[]
	@quite = true
	@readonly = true
	@recursive = true
    super()
	update_attributes Albacore.configuration.vss.to_hash
    @command = command unless command.nil?
  end

  def get_command_parameters
    command_params = []	
    command_params << "get"
    command_params << @project || "$/"
    command_params << "-Q" if @quite
    command_params << "-R" if @recursive
    command_params << (@readonly ? "-W-" : "-W")
    command_params << "-Y#{@username},#{@password}" unless @username.nil?
    command_params << "\"-GL#{@path}\"" unless @path.nil?
    command_params << @options.join(" ") unless @options.nil?
    command_params
  end

  def execute()
    fail_with_message 'Repository should be provided.' if @repository.nil?

    ENV["SSDIR"] = @repository

    result = run_command "VssGet", get_command_parameters

    failure_message = 'Visual SourceSafe Failed. See Build Log For Detail'
    fail_with_message failure_message if !result
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
albacore-0.3.6 lib/albacore/vssget.rb
albacore-1.0.0.rc.2 lib/albacore/vssget.rb
albacore-1.0.0.rc.1 lib/albacore/vssget.rb
albacore-0.3.5 lib/albacore/vssget.rb
albacore-0.3.4 lib/albacore/vssget.rb
albacore-0.3.3 lib/albacore/vssget.rb
albacore-0.3.2 lib/albacore/vssget.rb
albacore-0.3.1 lib/albacore/vssget.rb
albacore-0.3.0 lib/albacore/vssget.rb
albacore-0.2.7 lib/albacore/vssget.rb
albacore-0.2.6 lib/albacore/vssget.rb