Sha256: 9fa5128a0839c11eee2a818546245436b17f9d2c1ac47758a7cfe869114c40dd

Contents?: true

Size: 1.55 KB

Versions: 41

Compression:

Stored size: 1.55 KB

Contents

# Back sections:
# * Discussion Items
# * Review Outstanding Action Items
# * Unfinished Business
# * New Business
# * Announcements
# * Adjournment

class ASF::Board::Agenda
  parse do
    pattern = /
      ^(?<attach>(?:\s[89]|\s9|1\d)\.)
      \s(?<title>.*?)\n
      (?<text>.*?)
      (?=\n[\s1]\d\.|\n===)
    /mx

    scan @file, pattern do |attrs|
      attrs['attach'].strip!
      attrs['title'].sub! /^Review Outstanding /, ''

      if attrs['title'] =~ /Discussion|Action|Business|Announcements/
        attrs['prior_reports'] = minutes(attrs['title'])
      elsif attrs['title'] == 'Adjournment'
        attrs['timestamp'] = timestamp(attrs['text'][/\d+:\d+([ap]m)?/])
      end

      if attrs['title'] =~ /Action Items/

        # extract action items associated with projects
        text = attrs['text'].sub(/\A\s*\n/, '').sub(/\s+\Z/, '')
        unindent = text.sub(/s+\Z/,'').scan(/^ *\S/).map(&:length).min || 1
        text.gsub! /^ {#{unindent-1}}/, ''

        attrs['missing'] = text.empty?

        attrs['actions'] = text.sub(/^\* /, '').split(/^\n\* /).map do |text|
          match1 = /(.*?)(\n\s*Status:(.*))/m.match(text)
          match2 = /(.*?)(\[ ([^\]]+) \])?\s*\Z/m.match(match1[1])
          match3 = /(.*?): (.*)\Z/m.match(match2[1])
          match4 = /(.*?)( (\d+-\d+-\d+))?$/.match(match2[3])

          { 
            owner: match3[1],
            text: match3[2].strip,
            status: match1[3].to_s.strip,
            pmc: (match4[1] if match4), 
            date: (match4[3] if match4)
          }
        end
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
whimsy-asf-0.0.77 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.76 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.75 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.74 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.73 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.72 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.71 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.70 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.69 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.68 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.67 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.66 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.65 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.64 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.63 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.62 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.61 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.60 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.59 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.58 lib/whimsy/asf/agenda/back.rb