Class: RSCM::P4Client::P4Changelist

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log) ⇒ P4Changelist

Returns a new instance of P4Changelist.



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/rscm/scm/perforce.rb', line 413

def initialize(log)
  debug log
  if(log =~ /^Change (\d+) by (.*) on (.*)$/)
    #@number, @developer, @time = $1.to_i, $2, Time.utc(*ParseDate.parsedate($3)[0..5])
    @number, @developer, @time = $1.to_i, $2, Time.utc(*ParseDate.parsedate($3))
  else
    raise "Bad log format: '#{log}'"
  end

  if log =~ /Change (.*)\n\n(.*)\n\nAffected/m
    @message = $2.strip.gsub(/\n\t/, "\n")
  end

  @files = []
  log.each do |line|
    if line =~ /^\.\.\. \/\/depot\/(.+)#(\d+) (.+)/
      files << FileSpec.new($1, Integer($2), $3)
    end
  end
end

Instance Attribute Details

#developerObject (readonly)

Returns the value of attribute developer.



411
412
413
# File 'lib/rscm/scm/perforce.rb', line 411

def developer
  @developer
end

#filesObject (readonly)

Returns the value of attribute files.



411
412
413
# File 'lib/rscm/scm/perforce.rb', line 411

def files
  @files
end

#messageObject (readonly)

Returns the value of attribute message.



411
412
413
# File 'lib/rscm/scm/perforce.rb', line 411

def message
  @message
end

#numberObject (readonly)

Returns the value of attribute number.



411
412
413
# File 'lib/rscm/scm/perforce.rb', line 411

def number
  @number
end

#timeObject (readonly)

Returns the value of attribute time.



411
412
413
# File 'lib/rscm/scm/perforce.rb', line 411

def time
  @time
end