Sha256: 4536beb17b2f78345a33b1cf2e2c37118bbd9d6cdd14d93b353b382908c3bfc0

Contents?: true

Size: 1.25 KB

Versions: 14

Compression:

Stored size: 1.25 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/
        list = {}

        # extract action items associated with projects
        attrs['text'].to_s.split(/^\s+\* /).each do |action|
          next unless action =~ /\[ (\S*) \]\s*Status:/
          pmc = $1
          indent = action.scan(/\n +/).min
          action.gsub! indent, "\n" if indent
          action[/(\[ #{pmc} \])\s*Status:/, 1] = ''
          action.chomp!
          action.sub! /\s+Status:\Z/, ''
          list[pmc] ||= []
          list[pmc] << action
        end

        attrs['actions'] = list
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
whimsy-asf-0.0.22 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.21 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.20 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.19 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.18 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.17 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.16 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.15 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.14 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.13 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.12 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.11 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.10 lib/whimsy/asf/agenda/back.rb
whimsy-asf-0.0.9 lib/whimsy/asf/agenda/back.rb