Module: RedmineAvm::Patches::IssuePatch::InstanceMethods

Defined in:
lib/redmine_avm/patches/issue_patch.rb

Instance Method Summary collapse

Instance Method Details

#dependenciesObject



25
26
27
28
29
# File 'lib/redmine_avm/patches/issue_patch.rb', line 25

def dependencies
  children.all + relations_to.select do |r|
    r.relation_type == ::IssueRelation::TYPE_BLOCKS
  end.map(&:issue_from)
end

#dependencies_sectionObject



39
40
41
# File 'lib/redmine_avm/patches/issue_patch.rb', line 39

def dependencies_section
  description_section(::Avm::Settings.dependencies_section_title)
end

#dependencies_section_dependenciesObject



43
44
45
46
47
48
# File 'lib/redmine_avm/patches/issue_patch.rb', line 43

def dependencies_section_dependencies
  s = dependencies_section
  return [] unless s

  s.scan(/\#([0-9]+)/).map { |x| x[0].to_i }
end

#description_section(section_title) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/redmine_avm/patches/issue_patch.rb', line 16

def description_section(section_title)
  ['h\1\.', '----', '$'].each do |e|
    m = /h([0-9])\.\s*#{Regexp.escape(section_title)}(.+)#{e}/m
        .match(description)
    return m[2].strip + "\r\n" if m
  end
  nil
end

#r_dependenciesObject



31
32
33
34
35
36
37
# File 'lib/redmine_avm/patches/issue_patch.rb', line 31

def r_dependencies
  rd = []
  rd << parent if parent
  rd + relations_from.select do |r|
    r.relation_type == ::IssueRelation::TYPE_BLOCKS
  end.map(&:issue_to)
end

#undefined?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/redmine_avm/patches/issue_patch.rb', line 12

def undefined?
  status == ::Avm::Settings.issue_status_undefined
end