whimsy-asf 0.0.50 → 0.0.51

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 45f6932c6e7417fecb555f9ba2ad96d089c28912
4
+ data.tar.gz: 500006bdd3ff482dc2aaa39368f3c6cf3771370f
5
+ SHA512:
6
+ metadata.gz: 3f00500fb4c782d00b9e81930857289bcb0b98c0a57ab756d482eb8fb368be577e1fec7b1ca482156337eb855203ce0007f11ecf9566a0813a52b18fa01fad0e
7
+ data.tar.gz: be11a0baa8405604d97a350dd3c4b0a8a2b5a1f8d983efe9fff47db5be5c235e7c49fa15c763d2dc2ac77e1f7fde04a21b786505b6d5e611e805f7e98aa881b7
data/asf.version CHANGED
@@ -1 +1 @@
1
- 0.0.50
1
+ 0.0.51
@@ -1,52 +1,94 @@
1
1
  module ASF
2
2
 
3
3
  class ICLA
4
- include Enumerable
5
- ICLA_Struct = Struct.new(:id, :legal_name, :name, :email)
4
+ attr_accessor :id, :legal_name, :name, :email
6
5
 
6
+ @@mtime = nil
7
+
8
+ OFFICERS = ASF::SVN['private/foundation/officers']
9
+ SOURCE = "#{OFFICERS}/iclas.txt" if OFFICERS
10
+
11
+ # flush caches if source file changed
12
+ def self.refresh
13
+ if SOURCE and File.mtime(SOURCE) != @@mtime
14
+ @@mtime = File.mtime(SOURCE)
15
+ @@id_index = nil
16
+ @@email_index = nil
17
+ @@name_index = nil
18
+
19
+ @@availids = nil
20
+ end
21
+ end
22
+
23
+ # load ICLA information for every committer
7
24
  def self.preload
8
- new.each do |id, legal_name, name, email|
9
- if id != 'notinaval'
10
- ASF::Person.find(id).icla =
11
- ICLA_Struct.new(id, legal_name, name, email)
12
- end
25
+ refresh
26
+ each do |icla|
27
+ ASF::Person.find(icla.id).icla = icla unless icla.id == 'notinaval'
13
28
  end
14
29
  end
15
30
 
31
+ # find ICLA by ID
16
32
  def self.find_by_id(value)
17
33
  return if value == 'notinavail'
18
- new.each do |id, legal_name, name, email|
19
- if id == value
20
- return ICLA_Struct.new(id, legal_name, name, email)
21
- end
34
+
35
+ refresh
36
+ unless @@id_index
37
+ @@id_index = {}
38
+ each {|icla| @@id_index[icla.id] = icla}
22
39
  end
23
- nil
40
+
41
+ @@id_index[value]
24
42
  end
25
43
 
44
+ # find ICLA by email
26
45
  def self.find_by_email(value)
27
- value = value.downcase
28
- new.each do |id, legal_name, name, email|
29
- if email.downcase == value
30
- return ICLA_Struct.new(id, legal_name, name, email)
31
- end
46
+ refresh
47
+ unless @@email_index
48
+ @@email_index = {}
49
+ each {|icla| @@email_index[icla.email.downcase] = icla}
32
50
  end
33
- nil
51
+
52
+ @@email_index[value.downcase]
34
53
  end
35
54
 
55
+ # find ICLA by name
56
+ def self.find_by_name(value)
57
+ refresh
58
+ unless @@name_index
59
+ @@name_index = {}
60
+ each {|icla| @@name_index[icla.name] = icla}
61
+ end
62
+
63
+ @@email_index[value]
64
+ end
65
+
66
+ # list of all ids
36
67
  def self.availids
37
- return @availids if @availids
68
+ refresh
69
+ return @@availids if @@availids
38
70
  availids = []
39
- new.each do |id, legal_name, name, email|
40
- availids << id unless id == 'notinavail'
41
- end
71
+ each {|icla| availids << icla.id unless icla.id == 'notinavail'}
42
72
  @availids = availids
43
73
  end
44
74
 
45
- def each(&block)
46
- officers = ASF::SVN['private/foundation/officers']
47
- if officers and File.exist?("#{officers}/iclas.txt")
48
- iclas = File.read("#{officers}/iclas.txt")
49
- iclas.scan(/^([-\w]+):(.*?):(.*?):(.*?):/).each(&block)
75
+ # iterate over all of the ICLAs
76
+ def self.each(&block)
77
+ if @@id_index and not @@id_index.empty?
78
+ @@id_index.values.each(&block)
79
+ elsif @@email_index and not @@email_index.empty?
80
+ @@email_index.values.each(&block)
81
+ elsif @@name_index and not @@name_index.empty?
82
+ @@name_index.values.each(&block)
83
+ elsif File.exist?(SOURCE)
84
+ File.read(SOURCE).scan(/^([-\w]+):(.*?):(.*?):(.*?):/).each do |list|
85
+ icla = ICLA.new()
86
+ icla.id = list[0]
87
+ icla.legal_name = list[1]
88
+ icla.name = list[2]
89
+ icla.email = list[3]
90
+ block.call(icla)
91
+ end
50
92
  end
51
93
  end
52
94
 
@@ -149,7 +191,7 @@ module ASF
149
191
  end
150
192
 
151
193
  def icla?
152
- ICLA.availids.include? name
194
+ @icla || ICLA.availids.include?(name)
153
195
  end
154
196
  end
155
197
 
@@ -21,10 +21,11 @@ module ASF
21
21
  end
22
22
 
23
23
  # load all ICLA emails in one pass
24
- ASF::ICLA.new.each do |id, legal_name, name, email|
25
- list[email.downcase] ||= Person.find(id)
26
- next if id == 'notinavail'
27
- list["#{id.downcase}@apache.org"] ||= Person.find(id)
24
+ ASF::ICLA.each do |icla|
25
+ person = Person.find(icla.id)
26
+ list[icla.email.downcase] ||= person
27
+ next if icla.id == 'notinavail'
28
+ list["#{icla.id.downcase}@apache.org"] ||= person
28
29
  end
29
30
 
30
31
  @list = list
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whimsy-asf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.50
5
- prerelease:
4
+ version: 0.0.51
6
5
  platform: ruby
7
6
  authors:
8
7
  - Sam Ruby
@@ -14,153 +13,141 @@ dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: nokogiri
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rack
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: ruby-ldap
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: tzinfo
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: tzinfo-data
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: wunderbar
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
- description: ! " This package contains a set of classes which encapsulate access\n
111
- \ to a number of data sources such as LDAP, ICLAs, auth lists, etc.\n"
97
+ description: |2
98
+ This package contains a set of classes which encapsulate access
99
+ to a number of data sources such as LDAP, ICLAs, auth lists, etc.
112
100
  email: rubys@intertwingly.net
113
101
  executables: []
114
102
  extensions: []
115
103
  extra_rdoc_files: []
116
104
  files:
117
- - asf.version
118
105
  - asf.gemspec
106
+ - asf.version
119
107
  - lib/whimsy/asf.rb
120
- - lib/whimsy/asf/rack.rb
121
108
  - lib/whimsy/asf/agenda.rb
122
- - lib/whimsy/asf/svn.rb
123
- - lib/whimsy/asf/watch.rb
124
- - lib/whimsy/asf/config.rb
125
- - lib/whimsy/asf/podlings.rb
126
- - lib/whimsy/asf/nominees.rb
127
- - lib/whimsy/asf/auth.rb
128
- - lib/whimsy/asf/member.rb
129
- - lib/whimsy/asf/mail.rb
130
- - lib/whimsy/asf/agenda/special.rb
131
- - lib/whimsy/asf/agenda/committee.rb
132
- - lib/whimsy/asf/agenda/minutes.rb
133
109
  - lib/whimsy/asf/agenda/attachments.rb
110
+ - lib/whimsy/asf/agenda/back.rb
111
+ - lib/whimsy/asf/agenda/committee.rb
134
112
  - lib/whimsy/asf/agenda/exec-officer.rb
135
113
  - lib/whimsy/asf/agenda/front.rb
136
- - lib/whimsy/asf/agenda/back.rb
114
+ - lib/whimsy/asf/agenda/minutes.rb
115
+ - lib/whimsy/asf/agenda/special.rb
116
+ - lib/whimsy/asf/auth.rb
137
117
  - lib/whimsy/asf/committee.rb
118
+ - lib/whimsy/asf/config.rb
119
+ - lib/whimsy/asf/icla.rb
138
120
  - lib/whimsy/asf/ldap.rb
121
+ - lib/whimsy/asf/mail.rb
122
+ - lib/whimsy/asf/member.rb
123
+ - lib/whimsy/asf/nominees.rb
124
+ - lib/whimsy/asf/podlings.rb
125
+ - lib/whimsy/asf/rack.rb
139
126
  - lib/whimsy/asf/site.rb
140
- - lib/whimsy/asf/icla.rb
127
+ - lib/whimsy/asf/svn.rb
128
+ - lib/whimsy/asf/watch.rb
141
129
  homepage: https://whimsy.apache.org/
142
130
  licenses:
143
131
  - Apache License, Version 2.0
132
+ metadata: {}
144
133
  post_install_message:
145
134
  rdoc_options: []
146
135
  require_paths:
147
136
  - lib
148
137
  required_ruby_version: !ruby/object:Gem::Requirement
149
- none: false
150
138
  requirements:
151
- - - ! '>='
139
+ - - ">="
152
140
  - !ruby/object:Gem::Version
153
141
  version: '0'
154
142
  required_rubygems_version: !ruby/object:Gem::Requirement
155
- none: false
156
143
  requirements:
157
- - - ! '>='
144
+ - - ">="
158
145
  - !ruby/object:Gem::Version
159
146
  version: '0'
160
147
  requirements: []
161
148
  rubyforge_project:
162
- rubygems_version: 1.8.23
149
+ rubygems_version: 2.4.5.1
163
150
  signing_key:
164
- specification_version: 3
151
+ specification_version: 4
165
152
  summary: Whimsy 'model' of the ASF
166
153
  test_files: []