class QCloudHive::ProjectFeature

Public Class Methods

new(project, branch) click to toggle source
# File lib/qcloudhive/manifest.rb, line 99
def initialize(project, branch)
  @project = project
  @branch = branch
  #
  @remoteBranch = nil
end

Public Instance Methods

compareMaster() click to toggle source
# File lib/qcloudhive/manifest.rb, line 129
def compareMaster
  if @branch.name == "master"
    return 0
  end
  master = @project.gitRepo.branches["master"]
  localDate = DateTime.parse(@branch.gcommit.committer_date.to_s)
  masterLocalDate = master.gcommit.committer_date
  masterDate =  DateTime.parse(masterLocalDate.to_s)
  localDate <=> masterDate
end
compareRemote() click to toggle source
# File lib/qcloudhive/manifest.rb, line 119
def compareRemote
  localSha = @branch.gcommit.sha
  localDate = DateTime.parse(@branch.gcommit.committer_date.to_s)
  remtoeDate = DateTime.parse(self.remoteBranch.commit.committed_date)
  if  self.remoteBranch.commit.id != localSha
    return localDate <=> remtoeDate
  end
  return 0
end
local?() click to toggle source
# File lib/qcloudhive/manifest.rb, line 112
def local?
   if @branch.nil?
     return false
   end
   localBranch.local?
end
remoteBranch() click to toggle source
# File lib/qcloudhive/manifest.rb, line 105
def remoteBranch
  if @remoteBranch.nil?
    @remoteBranch = CodeOA.branch(@project.serverProject.id, @branch.name)
  end
  @remoteBranch
end