whimsy-asf 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/asf.version +1 -1
- data/lib/whimsy/asf/agenda.rb +15 -12
- data/lib/whimsy/asf/agenda/attachments.rb +8 -6
- data/lib/whimsy/asf/agenda/front.rb +40 -38
- data/lib/whimsy/asf/agenda/special.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6eb852ac4f2c64a970934863aa87e7291b6a82e1
|
4
|
+
data.tar.gz: 6578c7334388ad0120658dc0355a279c92952acd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c23650c64a464a1cd6d6d7ec6d516b5e3916f0563553252175b505979b62fb8b790f1ce9dda19541aba0e8a5f5bb27b0fb18834ff7c3f6b91072d58f89675d51
|
7
|
+
data.tar.gz: b00fef3cfaff262e35ec38e8916a35d6c94c4c8648a9f0bc75607568721b3b00d4faad53fc052b18303e604d36e5f0374a3ee9144c0cc8a2e810d3eca005ef7f
|
data/asf.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.10
|
data/lib/whimsy/asf/agenda.rb
CHANGED
@@ -23,9 +23,9 @@ class ASF::Board::Agenda
|
|
23
23
|
}
|
24
24
|
|
25
25
|
@@parsers = []
|
26
|
-
def self.parse(file=nil, &block)
|
26
|
+
def self.parse(file=nil, quick=false, &block)
|
27
27
|
@@parsers << block if block
|
28
|
-
new.parse(file) if file
|
28
|
+
new.parse(file, quick) if file
|
29
29
|
end
|
30
30
|
|
31
31
|
def initialize
|
@@ -50,8 +50,9 @@ class ASF::Board::Agenda
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
def parse(file)
|
53
|
+
def parse(file, quick=false)
|
54
54
|
@file = file
|
55
|
+
@quick = quick
|
55
56
|
|
56
57
|
if not @file.valid_encoding?
|
57
58
|
filter = Proc.new {|c| c.unpack('U').first rescue 0xFFFD}
|
@@ -84,16 +85,18 @@ class ASF::Board::Agenda
|
|
84
85
|
end
|
85
86
|
end
|
86
87
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
88
|
+
unless @quick
|
89
|
+
# add roster and prior report link
|
90
|
+
whimsy = 'https://whimsy.apache.org'
|
91
|
+
@sections.each do |section, hash|
|
92
|
+
next unless section =~ /^(4[A-Z]|\d+|[A-Z][A-Z]?)$/
|
93
|
+
committee = ASF::Committee.find(hash['title'] ||= 'UNKNOWN')
|
94
|
+
unless section =~ /^4[A-Z]$/
|
95
|
+
hash['roster'] =
|
96
|
+
"#{whimsy}/roster/committee/#{CGI.escape committee.name}"
|
97
|
+
end
|
98
|
+
hash['prior_reports'] = minutes(committee.display_name)
|
95
99
|
end
|
96
|
-
hash['prior_reports'] = minutes(committee.display_name)
|
97
100
|
end
|
98
101
|
|
99
102
|
# add attach to section
|
@@ -32,12 +32,14 @@ class ASF::Board::Agenda
|
|
32
32
|
|
33
33
|
attrs['missing'] = true if attrs['report'].strip.empty?
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
35
|
+
unless @quick
|
36
|
+
begin
|
37
|
+
committee = ASF::Committee.find(attrs['title'])
|
38
|
+
attrs['chair_email'] = committee.chair.mail.first
|
39
|
+
attrs['mail_list'] = committee.mail_list
|
40
|
+
attrs.delete('mail_list') if attrs['mail_list'].include? ' '
|
41
|
+
rescue
|
42
|
+
end
|
41
43
|
end
|
42
44
|
|
43
45
|
if attrs['report'].to_s.include? "\uFFFD"
|
@@ -20,52 +20,54 @@ class ASF::Board::Agenda
|
|
20
20
|
|
21
21
|
absent = attr['text'].scan(/Absent:\n\n.*?\n\n/m).join
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
unless @quick
|
24
|
+
# attempt to identify the people mentioned in the Roll Call
|
25
|
+
people = attr['text'].scan(/ {8}(\w.*)/).flatten.each do |sname|
|
26
|
+
name = sname
|
26
27
|
|
27
|
-
|
28
|
-
|
28
|
+
# first try the cache
|
29
|
+
person = @@people_cache[name]
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
# next try a simple name look up
|
32
|
+
if not person
|
33
|
+
search = ASF::Person.list("cn=#{name}")
|
34
|
+
person = search.first if search.length == 1
|
35
|
+
end
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
# finally try harder to match the name
|
38
|
+
if not person
|
39
|
+
sname = sname.strip.downcase.split(/\s+/)
|
39
40
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
if not list
|
42
|
+
ASF::Person.preload('cn')
|
43
|
+
list = ASF::Person.list
|
44
|
+
end
|
44
45
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
search = []
|
47
|
+
list.select do |person|
|
48
|
+
next if person == 'none'
|
49
|
+
pname = person.public_name.downcase.split(/\s+/)
|
50
|
+
if sname.all? {|t1| pname.any? {|t2| t2.start_with? t1}}
|
51
|
+
search << person
|
52
|
+
elsif pname.all? {|t1| sname.any? {|t2| t2.start_with? t1}}
|
53
|
+
search << person
|
54
|
+
end
|
55
|
+
end
|
55
56
|
|
56
|
-
|
57
|
-
|
57
|
+
person = search.first if search.length == 1
|
58
|
+
end
|
58
59
|
|
59
|
-
|
60
|
-
|
61
|
-
|
60
|
+
# save results in both the cache and the attributes
|
61
|
+
if person
|
62
|
+
@@people_cache[name] = person
|
62
63
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
64
|
+
attr['people'][person.id] = {
|
65
|
+
name: name,
|
66
|
+
member: person.asf_member?,
|
67
|
+
attending: !absent.include?(name)
|
68
|
+
}
|
69
|
+
end
|
70
|
+
end
|
69
71
|
end
|
70
72
|
elsif attr['title'] == 'Call to order'
|
71
73
|
attr['timestamp'] = timestamp(attr['text'][/\d+:\d+([ap]m)?/])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whimsy-asf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|