Class: Capistrano::Deploy::SCM::Accurev::InternalRevision

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/recipes/deploy/scm/accurev.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream, transaction_id) ⇒ InternalRevision

Returns a new instance of InternalRevision.



149
150
151
152
# File 'lib/capistrano/recipes/deploy/scm/accurev.rb', line 149

def initialize(stream, transaction_id)
  @stream = stream
  @transaction_id = transaction_id
end

Instance Attribute Details

#streamObject (readonly)

Returns the value of attribute stream.



138
139
140
# File 'lib/capistrano/recipes/deploy/scm/accurev.rb', line 138

def stream
  @stream
end

#transaction_idObject (readonly)

Returns the value of attribute transaction_id.



138
139
140
# File 'lib/capistrano/recipes/deploy/scm/accurev.rb', line 138

def transaction_id
  @transaction_id
end

Class Method Details

.parse(string) ⇒ Object



140
141
142
143
144
145
146
147
# File 'lib/capistrano/recipes/deploy/scm/accurev.rb', line 140

def self.parse(string)
  match = /([^\/]+)(\/(.+)){0,1}/.match(string)
  raise "Unrecognized revision identifier: #{string}" unless match

  stream = match[1]
  transaction_id = match[3] || 'highest'
  InternalRevision.new(stream, transaction_id)
end

Instance Method Details

#==(other) ⇒ Object



162
163
164
# File 'lib/capistrano/recipes/deploy/scm/accurev.rb', line 162

def ==(other)
  (stream == other.stream) && (transaction_id == other.transaction_id)
end

#psuedo_revision?Boolean

Returns:

  • (Boolean)


154
155
156
# File 'lib/capistrano/recipes/deploy/scm/accurev.rb', line 154

def psuedo_revision?
  @transaction_id == 'highest'
end

#to_sObject



158
159
160
# File 'lib/capistrano/recipes/deploy/scm/accurev.rb', line 158

def to_s
  "#{stream}/#{transaction_id}" 
end