Class: Ditz::Release

Inherits:
ModelObject show all
Defined in:
lib/ditz/model-objects.rb

Defined Under Namespace

Classes: Error

Instance Method Summary collapse

Methods inherited from ModelObject

#changed!, #changed?, changes_are_logged, create, create_interactively, #deserialized_form_of, #each_modelobject, field, field_names, from, inherited, #initialize, #inspect, #save!, #serialized_form_of, #to_s, #to_yaml, #to_yaml_type, #unchanged!, #validate!, yaml_domain, yaml_other_thing

Constructor Details

This class inherits a constructor from Ditz::ModelObject

Instance Method Details

#issues_from(project) ⇒ Object



21
# File 'lib/ditz/model-objects.rb', line 21

def issues_from project; project.issues.select { |i| i.release == name } end

#release!(project, who, comment) ⇒ Object

Raises:



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ditz/model-objects.rb', line 23

def release! project, who, comment
  raise Error, "already released" if released?

  issues = issues_from project
  bad = issues.find { |i| i.open? }
  raise Error, "open issue #{bad.name} must be reassigned" if bad

  self.release_time = Time.now
  self.status = :released
  log "released", who, comment
end

#released?Boolean

Returns:

  • (Boolean)


18
# File 'lib/ditz/model-objects.rb', line 18

def released?; self.status == :released end

#unreleased?Boolean

Returns:

  • (Boolean)


19
# File 'lib/ditz/model-objects.rb', line 19

def unreleased?; !released? end