Module: RedmineAvm::Patches::IssuePatch::InstanceMethods
- Defined in:
- lib/redmine_avm/patches/issue_patch.rb
Instance Method Summary collapse
- #dependencies ⇒ Object
- #dependencies_section ⇒ Object
- #dependencies_section_dependencies ⇒ Object
- #description_section(section_title) ⇒ Object
- #r_dependencies ⇒ Object
- #undefined? ⇒ Boolean
Instance Method Details
#dependencies ⇒ Object
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_section ⇒ Object
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_dependencies ⇒ Object
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_dependencies ⇒ Object
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
12 13 14 |
# File 'lib/redmine_avm/patches/issue_patch.rb', line 12 def undefined? status == ::Avm::Settings.issue_status_undefined end |