Class: RSCM::StarTeam

Inherits:
Base
  • Object
show all
Defined in:
lib/rscm/scm/star_team.rb

Overview

The RSCM StarTeam class requires that the following software be installed:

Constant Summary

Constants included from RevisionPoller

RevisionPoller::BASE_INCREMENT, RevisionPoller::CRITICAL_REVISION_SIZE, RevisionPoller::TWENTY_FOUR_HOURS

Instance Attribute Summary collapse

Attributes inherited from Base

#default_options, #store_revisions_command

Attributes included from RevisionPoller

#logger

Instance Method Summary collapse

Methods inherited from Base

#==, #add, #available?, #can_create_central?, #central_exists?, #checked_out?, #checked_out_files, #checkout_commandline, #checkout_dir, #checkout_dir=, #commit, #create_central, #destroy_central, #destroy_working_copy, #diff, #edit, #import_central, #install_trigger, #move, #open, #store_revisions_command?, #to_identifier, #to_yaml_properties, #transactional?, #trigger_installed?, #trigger_mechanism, #uninstall_trigger, #update_commandline, #uptodate?

Methods included from RevisionPoller

#poll

Constructor Details

#initialize(user_name = "", password = "", server_name = "", server_port = "", project_name = "", view_name = "", folder_name = "") ⇒ StarTeam

Returns a new instance of StarTeam.



29
30
31
# File 'lib/rscm/scm/star_team.rb', line 29

def initialize(user_name="", password="", server_name="", server_port="", project_name="", view_name="", folder_name="")
  @user_name, @password, @server_name, @server_port, @project_name, @view_name, @folder_name = user_name, password, server_name, server_port, project_name, view_name, folder_name
end

Instance Attribute Details

#folder_nameObject

Returns the value of attribute folder_name.



27
28
29
# File 'lib/rscm/scm/star_team.rb', line 27

def folder_name
  @folder_name
end

#passwordObject

Returns the value of attribute password.



22
23
24
# File 'lib/rscm/scm/star_team.rb', line 22

def password
  @password
end

#project_nameObject

Returns the value of attribute project_name.



25
26
27
# File 'lib/rscm/scm/star_team.rb', line 25

def project_name
  @project_name
end

#server_nameObject

Returns the value of attribute server_name.



23
24
25
# File 'lib/rscm/scm/star_team.rb', line 23

def server_name
  @server_name
end

#server_portObject

Returns the value of attribute server_port.



24
25
26
# File 'lib/rscm/scm/star_team.rb', line 24

def server_port
  @server_port
end

#user_nameObject

Returns the value of attribute user_name.



21
22
23
# File 'lib/rscm/scm/star_team.rb', line 21

def user_name
  @user_name
end

#view_nameObject

Returns the value of attribute view_name.



26
27
28
# File 'lib/rscm/scm/star_team.rb', line 26

def view_name
  @view_name
end

Instance Method Details

#checkout(checkout_dir, to_identifier, &proc) ⇒ Object



52
53
54
55
56
# File 'lib/rscm/scm/star_team.rb', line 52

def checkout(checkout_dir, to_identifier, &proc)
  # TODO: Take the to_identifier arg into consideration
  files = java("checkout(\"#{checkout_dir}\")", &proc)
  files
end

#revisions(checkout_dir, from_identifier = Time.epoch, to_identifier = Time.infinity, &proc) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/rscm/scm/star_team.rb', line 33

def revisions(checkout_dir, from_identifier=Time.epoch, to_identifier=Time.infinity, &proc)
  # just assuming it is a Time for now, may support labels later.
  # the java class really wants rfc822 and not rfc2822, but this works ok anyway.
  from = from_identifier.to_rfc2822
  to = to_identifier.to_rfc2822      

  revisions = java("getRevisions(\"#{from}\";\"#{to}\")", &proc)
  raise "revisions must be of type #{Revisions.name} - was #{revisions.class.name}" unless revisions.is_a?(::RSCM::Revisions)

  # Just a little sanity check
  if(revisions.latest)
    latetime = revisions.latest.time
    if(latetime < from_identifier || to_identifier < latetime)
      raise "Latest time (#{latetime}) is not within #{from_identifier}-#{to_identifier}"
    end
  end
  revisions
end

#supports_trigger?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/rscm/scm/star_team.rb', line 58

def supports_trigger?
  true
end