ncs_navigator_configuration 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,10 +1,17 @@
1
1
  NCS Navigator Configuration gem history
2
2
  =======================================
3
3
 
4
+ 0.3.0
5
+ -----
6
+
7
+ - New optional study center attribute: short_name. (#10)
8
+ - New optional attribute for Staff Portal and Core: mail_from. (#8)
9
+ - New optional study center attribute: `exception_email_recipients`. (#9)
10
+
4
11
  0.2.0
5
12
  -----
6
13
 
7
- - New mandatory study center attribute: recruitment_type_id.
14
+ - New mandatory study center attribute: `recruitment_type_id`.
8
15
 
9
16
  - Be more flexible about whitespace when parsing sampling unit CSV.
10
17
 
@@ -128,6 +128,8 @@ module NcsNavigator
128
128
  URI.parse(raw_value.to_s)
129
129
  when type == 'Boolean'
130
130
  raw_value.to_s.downcase.strip == 'true' ? true : false
131
+ when type == Array
132
+ coerce_to_string_array(raw_value)
131
133
  else
132
134
  fail "Do not know how to coerce to #{type} for #{name} from [#{section}]: #{key}"
133
135
  end
@@ -141,6 +143,10 @@ module NcsNavigator
141
143
  config.ini_filename.dirname + base
142
144
  end
143
145
  end
146
+
147
+ def coerce_to_string_array(raw_value)
148
+ raw_value.split(/\s*,\s*/)
149
+ end
144
150
  end
145
151
  end
146
152
 
@@ -172,6 +178,18 @@ module NcsNavigator
172
178
  configuration_attribute :recruitment_type_id, 'Study Center', 'recruitment_type_id', String,
173
179
  :required => true
174
180
 
181
+ ##
182
+ # A short, human-readable name or abbreviation for the Study
183
+ # Center.
184
+ configuration_attribute :study_center_short_name, 'Study Center', 'short_name', String,
185
+ :default => 'SC'
186
+
187
+ ##
188
+ # The e-mail addresses which will receive uncaught exceptions from
189
+ # any application in the suite.
190
+ configuration_attribute :exception_email_recipients, 'Study Center',
191
+ 'exception_email_recipients', Array, :default => []
192
+
175
193
  ##
176
194
  # The name for the institutional identity used in this deployment
177
195
  # of NCS Navigator. For instance, for the Greater Chicago Study
@@ -211,11 +229,21 @@ module NcsNavigator
211
229
  # the suite.
212
230
  configuration_attribute :staff_portal_uri, 'Staff Portal', 'uri', URI, :required => true
213
231
 
232
+ ##
233
+ # The address from which mail sent by Staff Portal will appear to come.
234
+ configuration_attribute :staff_portal_mail_from, 'Staff Portal', 'mail_from', String,
235
+ :default => 'ops@navigator.example.edu'
236
+
214
237
  ##
215
238
  # The root URI for the NCS Navigator Core deployment in this instance of
216
239
  # the suite.
217
240
  configuration_attribute :core_uri, 'Core', 'uri', URI, :required => true
218
241
 
242
+ ##
243
+ # The address from which mail sent by Core will appear to come.
244
+ configuration_attribute :core_mail_from, 'Core', 'mail_from', String,
245
+ :default => 'cases@navigator.example.edu'
246
+
219
247
  ##
220
248
  # The root URI for the PSC deployment in this instance of
221
249
  # the suite.
@@ -1,5 +1,5 @@
1
1
  module NcsNavigator
2
2
  class Configuration
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
@@ -23,6 +23,10 @@ sc_id = "20000000"
23
23
  # 4 => Original VC
24
24
  recruitment_type_id = "3"
25
25
 
26
+ # A short (5 chars or less) human-readable abbreviation for the study
27
+ # center.
28
+ short_name = 'MSC'
29
+
26
30
  # A pointer to a CSV describing the sampling units for this study
27
31
  # center. If the path is not absolute it will be resolved relative to
28
32
  # this file.
@@ -72,7 +76,7 @@ Chicago, IL 60611"
72
76
  # The root URI for Staff Portal.
73
77
  uri = "https://staffportal.greaterchicagoncs.org/"
74
78
 
75
- # The e-mail address from which mail sent by Staff Pportal will
79
+ # The e-mail address from which mail sent by Staff Portal will
76
80
  # appear to come.
77
81
  mail_from = "staffportal@greaterchicagoncs.org"
78
82
 
@@ -83,6 +87,10 @@ mail_from = "staffportal@greaterchicagoncs.org"
83
87
  # The root URI for NCS Navigator Core.
84
88
  uri = "https://ncsnavigator.greaterchicagoncs.org/"
85
89
 
90
+ # The e-mail address from which mail sent by Core will
91
+ # appear to come.
92
+ mail_from = "ncs-navigator@greaterchicagoncs.org"
93
+
86
94
  [PSC]
87
95
  # Configuration options which describe PSC as used by this instance of
88
96
  # the suite. (For now, PSC's own configuration options must be set
@@ -65,7 +65,7 @@ module NcsNavigator
65
65
  'uri' => 'https://sp.example.edu/'
66
66
  },
67
67
  'Core' => {
68
- 'uri' => 'https://ncsn.example.edu/'
68
+ 'uri' => 'https://ncsn.example.edu/',
69
69
  },
70
70
  'PSC' => {
71
71
  'uri' => 'https://psc.example.edu/'
@@ -131,6 +131,17 @@ module NcsNavigator
131
131
  end
132
132
  end
133
133
 
134
+ describe '#study_center_short_name' do
135
+ it 'defaults to SC' do
136
+ from_hash.study_center_short_name.should == 'SC'
137
+ end
138
+
139
+ it 'reflects the configured value' do
140
+ input_hash['Study Center']['short_name'] = 'GCSC'
141
+ from_hash.study_center_short_name.should == 'GCSC'
142
+ end
143
+ end
144
+
134
145
  describe '#study_center_username' do
135
146
  it 'reflects the configured value' do
136
147
  everything.study_center_username.should == 'NetID'
@@ -141,6 +152,19 @@ module NcsNavigator
141
152
  end
142
153
  end
143
154
 
155
+ describe '#exception_email_recipients' do
156
+ it 'reflects the configured value' do
157
+ everything.exception_email_recipients.should == [
158
+ 'Fred MacMurray <fred@pacificlife.net>',
159
+ 'Barbara Stanwyck <b@aol.com>'
160
+ ]
161
+ end
162
+
163
+ it 'is optional' do
164
+ from_hash.exception_email_recipients.should be_empty
165
+ end
166
+ end
167
+
144
168
  describe '#sampling_units_file' do
145
169
  it 'reflects the configured value, absolutized, when read from an INI' do
146
170
  everything.sampling_units_file.to_s.should ==
@@ -362,6 +386,16 @@ module NcsNavigator
362
386
  everything.staff_portal['mail_from'].should == "staffportal@greaterchicagoncs.org"
363
387
  end
364
388
  end
389
+
390
+ describe '#staff_portal_mail_from' do
391
+ it 'is the configured value' do
392
+ everything.staff_portal_mail_from.should == 'staffportal@greaterchicagoncs.org'
393
+ end
394
+
395
+ it 'has a reasonable default' do
396
+ from_hash.staff_portal_mail_from.should == 'ops@navigator.example.edu'
397
+ end
398
+ end
365
399
  end
366
400
 
367
401
  describe 'Core parts' do
@@ -382,6 +416,16 @@ module NcsNavigator
382
416
  everything.core['uri'].should == "https://ncsnavigator.greaterchicagoncs.org/"
383
417
  end
384
418
  end
419
+
420
+ describe '#core_mail_from' do
421
+ it 'is the configured value' do
422
+ everything.core_mail_from.should == 'ncs-navigator@greaterchicagoncs.org'
423
+ end
424
+
425
+ it 'has a reasonable default' do
426
+ from_hash.core_mail_from.should == 'cases@navigator.example.edu'
427
+ end
428
+ end
385
429
  end
386
430
 
387
431
  describe 'PSC parts' do
@@ -13,12 +13,15 @@ Northwestern University
13
13
  420 East Superior, 10th Floor
14
14
  Chicago, IL 60611"
15
15
 
16
+ exception_email_recipients = Fred MacMurray <fred@pacificlife.net>, Barbara Stanwyck <b@aol.com>
17
+
16
18
  [Staff Portal]
17
19
  uri = "https://staffportal.greaterchicagoncs.org/"
18
20
  mail_from = "staffportal@greaterchicagoncs.org"
19
21
 
20
22
  [Core]
21
23
  uri = "https://ncsnavigator.greaterchicagoncs.org/"
24
+ mail_from = "ncs-navigator@greaterchicagoncs.org"
22
25
 
23
26
  [PSC]
24
27
  uri = "https://calendar.greaterchicagoncs.org/"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ncs_navigator_configuration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-17 00:00:00.000000000Z
12
+ date: 2012-07-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ncs_mdes
16
- requirement: &2153498680 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0.4'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153498680
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '0.4'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: inifile
27
- requirement: &2153498160 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: 0.4.1
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *2153498160
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.4.1
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: fastercsv
38
- requirement: &2153497680 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '1.5'
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *2153497680
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.5'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: rake
49
- requirement: &2153497000 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ~>
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: 0.9.2
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *2153497000
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.9.2
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: rspec
60
- requirement: &2153487960 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ~>
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: '2.6'
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *2153487960
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '2.6'
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: yard
71
- requirement: &2153487480 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ~>
@@ -76,10 +101,15 @@ dependencies:
76
101
  version: 0.7.2
77
102
  type: :development
78
103
  prerelease: false
79
- version_requirements: *2153487480
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 0.7.2
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: fakefs
82
- requirement: &2153486920 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ~>
@@ -87,10 +117,15 @@ dependencies:
87
117
  version: 0.3.2
88
118
  type: :development
89
119
  prerelease: false
90
- version_requirements: *2153486920
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 0.3.2
91
126
  - !ruby/object:Gem::Dependency
92
127
  name: ci_reporter
93
- requirement: &2153486340 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
94
129
  none: false
95
130
  requirements:
96
131
  - - ~>
@@ -98,7 +133,12 @@ dependencies:
98
133
  version: '1.6'
99
134
  type: :development
100
135
  prerelease: false
101
- version_requirements: *2153486340
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ~>
140
+ - !ruby/object:Gem::Version
141
+ version: '1.6'
102
142
  description: ! "\n An internal component of the NCS Navigator suite, this gem provides
103
143
  a common view\n onto shared configuration elements.\n "
104
144
  email:
@@ -139,15 +179,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
179
  - - ! '>='
140
180
  - !ruby/object:Gem::Version
141
181
  version: '0'
182
+ segments:
183
+ - 0
184
+ hash: 2522240099632272850
142
185
  required_rubygems_version: !ruby/object:Gem::Requirement
143
186
  none: false
144
187
  requirements:
145
188
  - - ! '>='
146
189
  - !ruby/object:Gem::Version
147
190
  version: '0'
191
+ segments:
192
+ - 0
193
+ hash: 2522240099632272850
148
194
  requirements: []
149
195
  rubyforge_project:
150
- rubygems_version: 1.8.10
196
+ rubygems_version: 1.8.24
151
197
  signing_key:
152
198
  specification_version: 3
153
199
  summary: Common configuration elements for the NCS Navigator suite