whimsy-asf 0.0.18 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/asf.version +1 -1
- data/lib/whimsy/asf/agenda/front.rb +47 -40
- metadata +2 -2
data/asf.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.19
|
@@ -20,54 +20,61 @@ class ASF::Board::Agenda
|
|
20
20
|
|
21
21
|
absent = attr['text'].scan(/Absent:\n\n.*?\n\n/m).join
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
name = sname
|
23
|
+
# attempt to identify the people mentioned in the Roll Call
|
24
|
+
people = attr['text'].scan(/ {8}(\w.*)/).flatten.each do |sname|
|
25
|
+
next if sname == 'none'
|
27
26
|
|
28
|
-
|
29
|
-
|
27
|
+
name = sname
|
28
|
+
if @quick
|
29
|
+
attr['people'][name.gsub(/\W/, '_')] = {
|
30
|
+
name: name,
|
31
|
+
attending: !absent.include?(name)
|
32
|
+
}
|
33
|
+
else
|
30
34
|
|
31
|
-
|
32
|
-
|
33
|
-
search = ASF::Person.list("cn=#{name}")
|
34
|
-
person = search.first if search.length == 1
|
35
|
-
end
|
35
|
+
# first try the cache
|
36
|
+
person = @@people_cache[name]
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
38
|
+
# next try a simple name look up
|
39
|
+
if not person
|
40
|
+
search = ASF::Person.list("cn=#{name}")
|
41
|
+
person = search.first if search.length == 1
|
42
|
+
end
|
40
43
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
44
|
+
# finally try harder to match the name
|
45
|
+
if not person
|
46
|
+
sname = sname.strip.downcase.split(/\s+/)
|
45
47
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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
|
48
|
+
if not list
|
49
|
+
ASF::Person.preload('cn')
|
50
|
+
list = ASF::Person.list
|
51
|
+
end
|
56
52
|
|
57
|
-
|
58
|
-
|
53
|
+
search = []
|
54
|
+
list.select do |person|
|
55
|
+
next if person == 'none'
|
56
|
+
pname = person.public_name.downcase.split(/\s+/)
|
57
|
+
if sname.all? {|t1| pname.any? {|t2| t2.start_with? t1}}
|
58
|
+
search << person
|
59
|
+
elsif pname.all? {|t1| sname.any? {|t2| t2.start_with? t1}}
|
60
|
+
search << person
|
61
|
+
end
|
62
|
+
end
|
59
63
|
|
60
|
-
|
61
|
-
|
62
|
-
@@people_cache[name] = person
|
64
|
+
person = search.first if search.length == 1
|
65
|
+
end
|
63
66
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
# save results in both the cache and the attributes
|
68
|
+
if person
|
69
|
+
@@people_cache[name] = person
|
70
|
+
|
71
|
+
attr['people'][person.id] = {
|
72
|
+
name: name,
|
73
|
+
member: person.asf_member?,
|
74
|
+
attending: !absent.include?(name)
|
75
|
+
}
|
76
|
+
end
|
77
|
+
end
|
71
78
|
end
|
72
79
|
elsif attr['title'] == 'Call to order'
|
73
80
|
attr['timestamp'] = timestamp(attr['text'][/\d+:\d+([ap]m)?/])
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: whimsy-asf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.19
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Sam Ruby
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-04-
|
12
|
+
date: 2015-04-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
version_requirements: !ruby/object:Gem::Requirement
|