whimsy-asf 0.0.46 → 0.0.47

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bc6997362bf3158089292cac392c1739f19518a
4
- data.tar.gz: cb4e2622ea38148c6621d3f37cf6b9bac45d3457
3
+ metadata.gz: ea0528b059d622eb760257d915b5044cb034de40
4
+ data.tar.gz: 5614665e728a93c19d56bfb08209bbe537d27c4b
5
5
  SHA512:
6
- metadata.gz: e8cf182dc4f990db6aec7a24612f6ad73a6062e6d985cf7689459d99a36710b4b168bc6e02ff27eb757eea17492cf4f9c0efa49fe56d5fc4fc896edbe5694e70
7
- data.tar.gz: f6d32065c6acd7e25b02abddf5ff3650071c67a0f55852870f89935973cf843dbdaafaef1f30432f165a02deb4aae145e0aa908e774eee8d3d669364e59eac95
6
+ metadata.gz: 7ae73afac5989aff6ef50e3b331ebe62dd1ce8ee131b4aa9fd93c837ac37f506900e0e8f8e21c897757d37c948a5dda8f15e32e0a975f47b005b9dfaa992d835
7
+ data.tar.gz: 9199f3a82ce498a7a123a735a97c96d4bccc4f064721e0c7fb3a20da6cdddc423cc5b42a533ee1c8e80fa0ff389efdb471bba1d945243dea3a912fc8530da8f8
data/asf.version CHANGED
@@ -1 +1 @@
1
- 0.0.46
1
+ 0.0.47
@@ -23,9 +23,9 @@ class ASF::Board::Agenda
23
23
  officers = attr['text'].scan(/^ +Executive[ \S]*?:\n\n.*?\n\n/m).join
24
24
 
25
25
  # attempt to identify the people mentioned in the Roll Call
26
- people = attr['text'].scan(/ {8}(\w.*)/).flatten.each do |sname|
27
- next if sname == 'none'
28
- name = sname
26
+ people = attr['text'].scan(/ {8}(\w.*)/).flatten.each do |name|
27
+ next if name == 'none'
28
+ name.gsub! /\s*\(.*?\)/, ''
29
29
 
30
30
  role = :guest
31
31
  role = :director if directors.include? name
@@ -42,41 +42,12 @@ class ASF::Board::Agenda
42
42
  }
43
43
  else
44
44
 
45
- # first try the cache
46
- person = @@people_cache[name]
45
+ # look up name
46
+ search = ASF::Person.list("cn=#{name}")
47
47
 
48
- # next try a simple name look up
49
- if not person
50
- search = ASF::Person.list("cn=#{name}")
51
- person = search.first if search.length == 1
52
- end
53
-
54
- # finally try harder to match the name
55
- if not person
56
- sname = sname.strip.downcase.split(/\s+/)
57
-
58
- if not list
59
- ASF::Person.preload('cn')
60
- list = ASF::Person.list
61
- end
62
-
63
- search = []
64
- list.select do |person|
65
- next if person == 'none'
66
- pname = person.public_name.downcase.split(/\s+/)
67
- if sname.all? {|t1| pname.any? {|t2| t2.start_with? t1}}
68
- search << person
69
- elsif pname.all? {|t1| sname.any? {|t2| t2.start_with? t1}}
70
- search << person
71
- end
72
- end
73
-
74
- person = search.first if search.length == 1
75
- end
76
-
77
- # save results in both the cache and the attributes
78
- if person
79
- @@people_cache[name] = person
48
+ # if found, save results in the attributes
49
+ if search.length == 1
50
+ person = search.first
80
51
 
81
52
  attr['people'][person.id] = {
82
53
  name: name,
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.46
4
+ version: 0.0.47
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-09-04 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri