whimsy-asf 0.0.18 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
data/asf.version CHANGED
@@ -1 +1 @@
1
- 0.0.18
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
- 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
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
- # first try the cache
29
- person = @@people_cache[name]
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
- # 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
+ # first try the cache
36
+ person = @@people_cache[name]
36
37
 
37
- # finally try harder to match the name
38
- if not person
39
- sname = sname.strip.downcase.split(/\s+/)
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
- if not list
42
- ASF::Person.preload('cn')
43
- list = ASF::Person.list
44
- end
44
+ # finally try harder to match the name
45
+ if not person
46
+ sname = sname.strip.downcase.split(/\s+/)
45
47
 
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
48
+ if not list
49
+ ASF::Person.preload('cn')
50
+ list = ASF::Person.list
51
+ end
56
52
 
57
- person = search.first if search.length == 1
58
- end
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
- # save results in both the cache and the attributes
61
- if person
62
- @@people_cache[name] = person
64
+ person = search.first if search.length == 1
65
+ end
63
66
 
64
- attr['people'][person.id] = {
65
- name: name,
66
- member: person.asf_member?,
67
- attending: !absent.include?(name)
68
- }
69
- end
70
- end
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.18
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-01 00:00:00.000000000 Z
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