Class: RIM::RevStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/rim/rev_status.rb

Overview

RIM revision status object.

Revision status objects hold the RIM status of a specific project git revision. As a special case, this could also be the status of the current working copy.

The revision status consists of a set of module status objects, one for each module known to RIM in that revision. The module status points to a RimInfo object holding attribute values valid for that specific revision as well as the current dirty state as calculated by DirtyCheck and the module directory.

Revsion status objects can have parent status objects. This way, chains and even trees of status objects can be built. For example in case of a merge commit, the corresponding status object would have two parent status objects, one for each parent git commit.

Defined Under Namespace

Classes: ModuleStatus

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(modules) ⇒ RevStatus

Returns a new instance of RevStatus.



46
47
48
49
# File 'lib/rim/rev_status.rb', line 46

def initialize(modules)
  @modules = modules
  @parents = []
end

Instance Attribute Details

#git_revObject

git revision (sha1) for which this status was created or nil if the status wasn’t created for a git revision



22
23
24
# File 'lib/rim/rev_status.rb', line 22

def git_rev
  @git_rev
end

#modulesObject (readonly)

module status objects



24
25
26
# File 'lib/rim/rev_status.rb', line 24

def modules
  @modules
end

#parentsObject (readonly)

references to RevStatus objects of parent commits



26
27
28
# File 'lib/rim/rev_status.rb', line 26

def parents
  @parents
end

Instance Method Details

#dirty?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/rim/rev_status.rb', line 51

def dirty?
  modules.any?{|m| m.dirty?}
end