etda_utilities 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/ruby-ci.yml +43 -0
- data/.gitignore +12 -0
- data/.rspec +4 -0
- data/.rubocop.yml +160 -0
- data/.rubocop_todo.yml +231 -0
- data/.ruby-version +1 -0
- data/.travis.yml +33 -0
- data/CODEOWNERS +11 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +65 -0
- data/LICENSE.txt +21 -0
- data/README.md +48 -0
- data/Rakefile +8 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/etda_utilities.gemspec +28 -0
- data/lib/etda_utilities/access_level.rb +101 -0
- data/lib/etda_utilities/access_levels_for_partners.yml +72 -0
- data/lib/etda_utilities/etda_file_paths.rb +55 -0
- data/lib/etda_utilities/hosts.rb +49 -0
- data/lib/etda_utilities/partner.rb +37 -0
- data/lib/etda_utilities/version.rb +5 -0
- data/lib/etda_utilities.rb +11 -0
- metadata +110 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 77d38fc8a2f016ca6018857878f4bb0a4acd93e0a3bc3454a643fa9ca41228f8
|
4
|
+
data.tar.gz: 7b5476defcd59ed704568482211e89de751d4591775276574237b2f16d438b50
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 158a45acfd648d898ba2c5afee01b45aa4a3c89028437aa824026c54e67bea3a999dee2668d349d951e9c754862ebab801237d8523f5cb2f711c91140f7d0e48
|
7
|
+
data.tar.gz: 6f11de8831051992b6eed890ed0b8c2dcae6ad80d608e3cbe3eb603dfe5e3ca7e31e813af66f86f2357519bf42534dd996fa1f5ac4b026fc0d7a09af04701f12
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub. They are
|
2
|
+
# provided by a third-party and are governed by separate terms of service,
|
3
|
+
# privacy policy, and support documentation.
|
4
|
+
#
|
5
|
+
# This workflow will install a prebuilt Ruby version, install dependencies, and
|
6
|
+
# run tests and linters.
|
7
|
+
name: "Ruby on Rails CI"
|
8
|
+
on:
|
9
|
+
push:
|
10
|
+
branches: [ main ]
|
11
|
+
pull_request:
|
12
|
+
branches: [ main ]
|
13
|
+
jobs:
|
14
|
+
test:
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
env:
|
17
|
+
RAILS_ENV: test
|
18
|
+
steps:
|
19
|
+
- name: Checkout code
|
20
|
+
uses: actions/checkout@v2
|
21
|
+
# Add or replace dependency steps here
|
22
|
+
- name: Install Ruby and gems
|
23
|
+
uses: ruby/setup-ruby@8f312efe1262fb463d906e9bf040319394c18d3e # v1.92
|
24
|
+
with:
|
25
|
+
bundler-cache: true
|
26
|
+
# Add or replace test runners here
|
27
|
+
- name: Run tests
|
28
|
+
run: RAILS_ENV=test bundle exec rspec
|
29
|
+
|
30
|
+
lint:
|
31
|
+
runs-on: ubuntu-latest
|
32
|
+
steps:
|
33
|
+
- name: Checkout code
|
34
|
+
uses: actions/checkout@v2
|
35
|
+
- name: Install Ruby and gems
|
36
|
+
uses: ruby/setup-ruby@8f312efe1262fb463d906e9bf040319394c18d3e # v1.92
|
37
|
+
with:
|
38
|
+
bundler-cache: true
|
39
|
+
# Add or replace any other lints here
|
40
|
+
- name: Security audit dependencies
|
41
|
+
run: bundle exec bundle-audit
|
42
|
+
- name: Lint Ruby files
|
43
|
+
run: bundle exec rubocop
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
require: rubocop-rspec
|
4
|
+
|
5
|
+
Layout/LineLength:
|
6
|
+
Enabled: false
|
7
|
+
|
8
|
+
Metrics/AbcSize:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
Metrics/BlockLength:
|
12
|
+
Exclude:
|
13
|
+
- spec/lib/etda_utilities_etda_file_paths_spec.rb
|
14
|
+
|
15
|
+
Metrics/MethodLength:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
Metrics/ClassLength:
|
19
|
+
Exclude:
|
20
|
+
- 'app/controllers/author/submissions_controller.rb'
|
21
|
+
- 'app/controllers/ldap_lookup_controller.rb'
|
22
|
+
- 'app/models/author.rb'
|
23
|
+
- 'app/models/ldap_result.rb'
|
24
|
+
- 'app/controllers/admin/submissions_controller.rb'
|
25
|
+
- 'app/controllers/catalog_controller.rb'
|
26
|
+
- 'app/models/legacy/main_submission.rb'
|
27
|
+
- 'app/models/submission.rb'
|
28
|
+
- 'app/presenters/admin/submissions_dashboard_view.rb'
|
29
|
+
- 'app/presenters/admin/submissions_index_view.rb'
|
30
|
+
- 'app/presenters/submission_view.rb'
|
31
|
+
- 'app/models/ldap_university_directory.rb'
|
32
|
+
|
33
|
+
Metrics/CyclomaticComplexity:
|
34
|
+
Exclude:
|
35
|
+
- 'app/models/legacy/main_submission.rb'
|
36
|
+
- 'app/presenters/admin/submission_form_view.rb'
|
37
|
+
- 'app/presenters/admin/submissions_index_view.rb'
|
38
|
+
- 'app/models/ldap_university_directory.rb'
|
39
|
+
|
40
|
+
Metrics/PerceivedComplexity:
|
41
|
+
Exclude:
|
42
|
+
- 'app/models/legacy/main_submission.rb'
|
43
|
+
- 'app/presenters/admin/submission_form_view.rb'
|
44
|
+
- 'app/presenters/admin/submissions_index_view.rb'
|
45
|
+
- 'app/models/ldap_university_directory.rb'
|
46
|
+
|
47
|
+
Layout/MultilineBlockLayout:
|
48
|
+
Exclude:
|
49
|
+
|
50
|
+
Layout/IndentationConsistency:
|
51
|
+
EnforcedStyle: indented_internal_methods
|
52
|
+
|
53
|
+
Style/CollectionMethods:
|
54
|
+
PreferredMethods:
|
55
|
+
collect: 'map'
|
56
|
+
collect!: 'map!'
|
57
|
+
inject: 'reduce'
|
58
|
+
detect: 'find'
|
59
|
+
find_all: 'select'
|
60
|
+
|
61
|
+
Style/WordArray:
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
Style/RegexpLiteral:
|
65
|
+
Enabled: false
|
66
|
+
|
67
|
+
Style/StringLiterals:
|
68
|
+
Enabled: false
|
69
|
+
|
70
|
+
Style/ClassAndModuleChildren:
|
71
|
+
Enabled: false
|
72
|
+
|
73
|
+
Style/Documentation:
|
74
|
+
Enabled: false
|
75
|
+
|
76
|
+
Style/SingleLineBlockParams:
|
77
|
+
Enabled: false
|
78
|
+
|
79
|
+
Style/SignalException:
|
80
|
+
Enabled: false
|
81
|
+
|
82
|
+
Style/HashEachMethods:
|
83
|
+
Enabled: true
|
84
|
+
|
85
|
+
Style/HashTransformKeys:
|
86
|
+
Enabled: true
|
87
|
+
|
88
|
+
Style/HashTransformValues:
|
89
|
+
Enabled: true
|
90
|
+
|
91
|
+
Style/ClassVars:
|
92
|
+
Exclude:
|
93
|
+
- 'spec/support/authentication.rb'
|
94
|
+
|
95
|
+
Naming/VariableName:
|
96
|
+
Exclude:
|
97
|
+
- 'lib/share_notify/push_document.rb'
|
98
|
+
|
99
|
+
Style/TernaryParentheses:
|
100
|
+
Exclude:
|
101
|
+
- 'lib/etda_utilities/etda_file_paths.rb'
|
102
|
+
|
103
|
+
Style/FormatStringToken:
|
104
|
+
Exclude:
|
105
|
+
- 'lib/etda_utilities/etda_file_paths.rb'
|
106
|
+
|
107
|
+
Layout/SpaceInsideBlockBraces:
|
108
|
+
Exclude:
|
109
|
+
- 'spec/component/models/solr_data_import_service_spec.rb'
|
110
|
+
|
111
|
+
Layout/SpaceInsideHashLiteralBraces:
|
112
|
+
Exclude:
|
113
|
+
- 'spec/component/models/solr_data_import_service_spec.rb'
|
114
|
+
|
115
|
+
Naming/AccessorMethodName:
|
116
|
+
Exclude:
|
117
|
+
|
118
|
+
Naming/PredicateName:
|
119
|
+
Exclude:
|
120
|
+
|
121
|
+
Lint/SuppressedException:
|
122
|
+
Exclude:
|
123
|
+
|
124
|
+
RSpec/ExampleLength:
|
125
|
+
Enabled: false
|
126
|
+
|
127
|
+
RSpec/ExampleWording:
|
128
|
+
CustomTransform:
|
129
|
+
be: is
|
130
|
+
have: has
|
131
|
+
not: does not
|
132
|
+
NOT: does NOT
|
133
|
+
IgnoredWords:
|
134
|
+
- only
|
135
|
+
|
136
|
+
RSpec/FilePath:
|
137
|
+
Enabled: false
|
138
|
+
|
139
|
+
RSpec/InstanceVariable:
|
140
|
+
Enabled: false
|
141
|
+
|
142
|
+
RSpec/DescribeClass:
|
143
|
+
Exclude:
|
144
|
+
|
145
|
+
Style/NumericLiterals:
|
146
|
+
Exclude:
|
147
|
+
- 'spec/lib/etda_utilities_etda_file_paths_spec.rb'
|
148
|
+
|
149
|
+
RSpec/MultipleDescribes:
|
150
|
+
Enabled: false
|
151
|
+
|
152
|
+
RSpec/MultipleExpectations:
|
153
|
+
Exclude:
|
154
|
+
- 'spec/lib/etda_utilities_access_level_spec.rb'
|
155
|
+
|
156
|
+
Style/BlockDelimiters:
|
157
|
+
Exclude:
|
158
|
+
|
159
|
+
Naming/FileName:
|
160
|
+
Exclude:
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,231 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2018-01-18 11:51:23 -0500 using RuboCop version 0.52.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 2
|
10
|
+
# Cop supports --auto-correct.
|
11
|
+
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
|
12
|
+
Layout/ExtraSpacing:
|
13
|
+
Exclude:
|
14
|
+
- 'etda_utilities-0.3.0/etda_utilities.gemspec'
|
15
|
+
- 'etda_utilities.gemspec'
|
16
|
+
|
17
|
+
# Offense count: 6
|
18
|
+
# Cop supports --auto-correct.
|
19
|
+
# Configuration parameters: EnforcedStyle.
|
20
|
+
# SupportedStyles: normal, rails
|
21
|
+
Layout/IndentationConsistency:
|
22
|
+
Exclude:
|
23
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/access_level.rb'
|
24
|
+
- 'lib/etda_utilities/access_level.rb'
|
25
|
+
|
26
|
+
# Offense count: 2
|
27
|
+
# Cop supports --auto-correct.
|
28
|
+
# Configuration parameters: AllowForAlignment.
|
29
|
+
Layout/SpaceAroundOperators:
|
30
|
+
Exclude:
|
31
|
+
# - 'etda_utilities-0.3.0/etda_utilities.gemspec'
|
32
|
+
- 'etda_utilities.gemspec'
|
33
|
+
|
34
|
+
# Offense count: 2
|
35
|
+
# Cop supports --auto-correct.
|
36
|
+
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
37
|
+
# SupportedStyles: space, no_space
|
38
|
+
# SupportedStylesForEmptyBraces: space, no_space
|
39
|
+
Layout/SpaceInsideBlockBraces:
|
40
|
+
Exclude:
|
41
|
+
- 'Gemfile'
|
42
|
+
- 'etda_utilities-0.3.0/Gemfile'
|
43
|
+
|
44
|
+
# Offense count: 4
|
45
|
+
# Cop supports --auto-correct.
|
46
|
+
Layout/SpaceInsidePercentLiteralDelimiters:
|
47
|
+
Exclude:
|
48
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/partner.rb'
|
49
|
+
- 'lib/etda_utilities/partner.rb'
|
50
|
+
|
51
|
+
# Offense count: 2
|
52
|
+
# Cop supports --auto-correct.
|
53
|
+
# Configuration parameters: EnforcedStyle.
|
54
|
+
# SupportedStyles: final_newline, final_blank_line
|
55
|
+
Layout/TrailingEmptyLines:
|
56
|
+
Exclude:
|
57
|
+
- 'Gemfile'
|
58
|
+
- 'etda_utilities-0.3.0/Gemfile'
|
59
|
+
|
60
|
+
# Offense count: 2
|
61
|
+
Lint/Void:
|
62
|
+
Exclude:
|
63
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/access_level.rb'
|
64
|
+
- 'lib/etda_utilities/access_level.rb'
|
65
|
+
|
66
|
+
# Offense count: 5
|
67
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
68
|
+
Metrics/BlockLength:
|
69
|
+
Max: 63
|
70
|
+
|
71
|
+
# Offense count: 9
|
72
|
+
# Configuration parameters: Prefixes.
|
73
|
+
# Prefixes: when, with, without
|
74
|
+
RSpec/ContextWording:
|
75
|
+
Exclude:
|
76
|
+
- 'spec/lib/etda_utilities_access_level_spec.rb'
|
77
|
+
- 'spec/lib/etda_utilities_etda_file_paths_spec.rb'
|
78
|
+
|
79
|
+
# Offense count: 3
|
80
|
+
# Configuration parameters: CustomTransform, IgnoreMethods.
|
81
|
+
RSpec/FilePath:
|
82
|
+
Exclude:
|
83
|
+
- 'spec/lib/etda_utilities_access_level_spec.rb'
|
84
|
+
- 'spec/lib/etda_utilities_etda_file_paths_spec.rb'
|
85
|
+
- 'spec/lib/etda_utilities_partner_spec.rb'
|
86
|
+
|
87
|
+
# Offense count: 8
|
88
|
+
# Configuration parameters: AggregateFailuresByDefault.
|
89
|
+
RSpec/MultipleExpectations:
|
90
|
+
Max: 3
|
91
|
+
|
92
|
+
# Offense count: 5
|
93
|
+
RSpec/NamedSubject:
|
94
|
+
Exclude:
|
95
|
+
- 'spec/lib/etda_utilities_etda_file_paths_spec.rb'
|
96
|
+
- 'spec/lib/etda_utilities_hosts_spec.rb'
|
97
|
+
|
98
|
+
# Offense count: 9
|
99
|
+
# Configuration parameters: Strict, EnforcedStyle.
|
100
|
+
# SupportedStyles: inflected, explicit
|
101
|
+
RSpec/PredicateMatcher:
|
102
|
+
Exclude:
|
103
|
+
- 'spec/lib/etda_utilities_partner_spec.rb'
|
104
|
+
|
105
|
+
# Offense count: 10
|
106
|
+
Style/Documentation:
|
107
|
+
Exclude:
|
108
|
+
- 'spec/**/*'
|
109
|
+
- 'test/**/*'
|
110
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities.rb'
|
111
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/access_level.rb'
|
112
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/etda_file_paths.rb'
|
113
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/partner.rb'
|
114
|
+
- 'lib/etda_utilities.rb'
|
115
|
+
- 'lib/etda_utilities/access_level.rb'
|
116
|
+
- 'lib/etda_utilities/etda_file_paths.rb'
|
117
|
+
- 'lib/etda_utilities/partner.rb'
|
118
|
+
|
119
|
+
# Offense count: 23
|
120
|
+
# Cop supports --auto-correct.
|
121
|
+
# Configuration parameters: EnforcedStyle.
|
122
|
+
# SupportedStyles: when_needed, always, never
|
123
|
+
Style/FrozenStringLiteralComment:
|
124
|
+
Enabled: false
|
125
|
+
|
126
|
+
# Offense count: 2
|
127
|
+
# Configuration parameters: MinBodyLength.
|
128
|
+
Style/GuardClause:
|
129
|
+
Exclude:
|
130
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/access_level.rb'
|
131
|
+
- 'lib/etda_utilities/access_level.rb'
|
132
|
+
|
133
|
+
# Offense count: 2
|
134
|
+
# Cop supports --auto-correct.
|
135
|
+
Style/IfUnlessModifier:
|
136
|
+
Exclude:
|
137
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/partner.rb'
|
138
|
+
- 'lib/etda_utilities/partner.rb'
|
139
|
+
|
140
|
+
Style/MissingRespondToMissing:
|
141
|
+
# Offense count: 2
|
142
|
+
Exclude:
|
143
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/access_level.rb'
|
144
|
+
- 'lib/etda_utilities/access_level.rb'
|
145
|
+
|
146
|
+
# Offense count: 12
|
147
|
+
# Cop supports --auto-correct.
|
148
|
+
Style/MutableConstant:
|
149
|
+
Exclude:
|
150
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/access_level.rb'
|
151
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/etda_file_paths.rb'
|
152
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/partner.rb'
|
153
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/version.rb'
|
154
|
+
- 'lib/etda_utilities/access_level.rb'
|
155
|
+
- 'lib/etda_utilities/etda_file_paths.rb'
|
156
|
+
- 'lib/etda_utilities/partner.rb'
|
157
|
+
- 'lib/etda_utilities/version.rb'
|
158
|
+
|
159
|
+
# Offense count: 6
|
160
|
+
# Cop supports --auto-correct.
|
161
|
+
# Configuration parameters: PreferredDelimiters.
|
162
|
+
Style/PercentLiteralDelimiters:
|
163
|
+
Exclude:
|
164
|
+
- 'etda_utilities-0.3.0/etda_utilities.gemspec'
|
165
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/partner.rb'
|
166
|
+
- 'etda_utilities.gemspec'
|
167
|
+
- 'lib/etda_utilities/partner.rb'
|
168
|
+
|
169
|
+
# Offense count: 2
|
170
|
+
# Cop supports --auto-correct.
|
171
|
+
Style/RedundantParentheses:
|
172
|
+
Exclude:
|
173
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/access_level.rb'
|
174
|
+
- 'lib/etda_utilities/access_level.rb'
|
175
|
+
|
176
|
+
# Offense count: 2
|
177
|
+
# Cop supports --auto-correct.
|
178
|
+
Style/RedundantSelf:
|
179
|
+
Exclude:
|
180
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/etda_file_paths.rb'
|
181
|
+
|
182
|
+
# Offense count: 54
|
183
|
+
# Cop supports --auto-correct.
|
184
|
+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
185
|
+
# SupportedStyles: single_quotes, double_quotes
|
186
|
+
Style/StringLiterals:
|
187
|
+
Exclude:
|
188
|
+
- 'Gemfile'
|
189
|
+
- 'Rakefile'
|
190
|
+
- 'bin/console'
|
191
|
+
- 'etda_utilities-0.3.0/Gemfile'
|
192
|
+
- 'etda_utilities-0.3.0/Rakefile'
|
193
|
+
- 'etda_utilities-0.3.0/bin/console'
|
194
|
+
- 'etda_utilities-0.3.0/etda_utilities.gemspec'
|
195
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/version.rb'
|
196
|
+
- 'etda_utilities.gemspec'
|
197
|
+
- 'lib/etda_utilities/version.rb'
|
198
|
+
- 'spec/etda_utilities_spec.rb'
|
199
|
+
- 'spec/spec_helper.rb'
|
200
|
+
|
201
|
+
# Offense count: 28
|
202
|
+
# Cop supports --auto-correct.
|
203
|
+
Style/RedundantInterpolation:
|
204
|
+
Exclude:
|
205
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/access_level.rb'
|
206
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/etda_file_paths.rb'
|
207
|
+
- 'lib/etda_utilities/access_level.rb'
|
208
|
+
- 'lib/etda_utilities/etda_file_paths.rb'
|
209
|
+
|
210
|
+
# Offense count: 4
|
211
|
+
# Cop supports --auto-correct.
|
212
|
+
Style/RedundantPercentQ:
|
213
|
+
Exclude:
|
214
|
+
- 'etda_utilities-0.3.0/etda_utilities.gemspec'
|
215
|
+
- 'etda_utilities.gemspec'
|
216
|
+
|
217
|
+
# Offense count: 3
|
218
|
+
# Cop supports --auto-correct.
|
219
|
+
# Configuration parameters: EnforcedStyle, MinSize, WordRegex.
|
220
|
+
# SupportedStyles: percent, brackets
|
221
|
+
Style/WordArray:
|
222
|
+
Exclude:
|
223
|
+
- 'etda_utilities-0.3.0/lib/etda_utilities/access_level.rb'
|
224
|
+
- 'lib/etda_utilities/access_level.rb'
|
225
|
+
- 'spec/lib/etda_utilities_access_level_spec.rb'
|
226
|
+
|
227
|
+
# Offense count: 42
|
228
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
229
|
+
# URISchemes: http, https
|
230
|
+
Layout/LineLength:
|
231
|
+
Max: 132
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.4
|
data/.travis.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
sudo: required
|
4
|
+
#rvm:
|
5
|
+
#- 2.6.0
|
6
|
+
jdk:
|
7
|
+
- oraclejdk12
|
8
|
+
env:
|
9
|
+
global:
|
10
|
+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
11
|
+
- JS=true
|
12
|
+
before_install:
|
13
|
+
- "gem --version"
|
14
|
+
- "gem update --system"
|
15
|
+
- "gem --version"
|
16
|
+
- 'gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"'
|
17
|
+
script:
|
18
|
+
- gem install bundler
|
19
|
+
- gem install rspec
|
20
|
+
- bundle exec rubocop
|
21
|
+
- bundle exec rspec
|
22
|
+
notifications:
|
23
|
+
email:
|
24
|
+
recipients:
|
25
|
+
secure: "l84DQVl48Z4/O/H/zAHFL6GmnBe5BHGQZj2rBv2/X7j1QfOOQEb3h0ZVk5+RdlGLvNjgc8va0sI6JJWa8QuQa68/T6RfcBoZHb90pKOIRoZOVjiwwUYC+mdRMv5s0vemJ2VxreAoJl5JmJ6TLvy5w52G7mmMOm+1VuYPv3MuvZ3nbFwm15qz6LxiRhyUJhaXcZhi1emZYsRd+qazQ9HlkKWMoCz68gi8zWVULnRbZSIHIEj4GV5bn9L67u+699LgIjKrT1Xeh0wnb/wtPIrgwheSksgqYcaRRkBmkaajjss2Zeg5m5hUteTTsx6mSAk3QSTjqVQ0t/Kh5En68W4B/VnA8qiuLolzHqaTqid8sa4rvh/JVAU3zsOvMun5f3OZzdgf7VTXM/E3A+L25KrVTk9UcQnPHcvJvdAIlr0ZZTX2G+3Vs/XSEPQk4KRfLFSqLUm4uYvh9INki7SlB7lllYudSMQzV/5Ghg2K6UaxP9PDRRxOCVPWeYuR3H3tesdBciv+6+d3LxDdAWVbxZwphlGtS5N7NlIl2du888wQ5COaOwSAlXIQWdRvvVfvvQaTTY245jdsiToNX+KSf27bT+szpHyzOaIsT1kO4DAIdSlSxdSK600GsM5RY80iIF92mFc9EjK24WqFZ0PpaSRZ3L4aUvl+HbdS/K4+q1uTCTM="
|
26
|
+
on_success: change
|
27
|
+
on_failure: always
|
28
|
+
irc:
|
29
|
+
channels:
|
30
|
+
template:
|
31
|
+
|
32
|
+
|
33
|
+
|
data/CODEOWNERS
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Each line is a file pattern followed by one or more owners.
|
2
|
+
|
3
|
+
# These owners will be the default owners for everything in
|
4
|
+
# the repo. Unless a later match takes precedence,
|
5
|
+
# space separated list of users/teams will be requested for
|
6
|
+
# review when someone opens a pull request. Syntax is the same
|
7
|
+
# as with .gitignore. More info here:
|
8
|
+
# https://help.github.com/articles/about-codeowners/
|
9
|
+
#
|
10
|
+
# Global CODEOWNERS
|
11
|
+
* @andrewgearhart @ajkiessl @jrpatterson
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at jrp22@psu.edu. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
6
|
+
|
7
|
+
# Specify your gem's dependencies in etda_utilities.gemspec
|
8
|
+
gemspec
|
9
|
+
|
10
|
+
gem 'rubocop', require: false
|
11
|
+
gem 'rubocop-rspec', require: false
|
12
|
+
|
13
|
+
gem 'byebug', require: false
|
14
|
+
|
15
|
+
gem 'bundle-audit', require: false
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
etda_utilities (0.16.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ast (2.4.0)
|
10
|
+
bundle-audit (0.1.0)
|
11
|
+
bundler-audit
|
12
|
+
bundler-audit (0.6.1)
|
13
|
+
bundler (>= 1.2.0, < 3)
|
14
|
+
thor (~> 0.18)
|
15
|
+
byebug (11.1.1)
|
16
|
+
diff-lcs (1.3)
|
17
|
+
jaro_winkler (1.5.4)
|
18
|
+
parallel (1.19.1)
|
19
|
+
parser (2.7.0.5)
|
20
|
+
ast (~> 2.4.0)
|
21
|
+
rainbow (3.0.0)
|
22
|
+
rake (13.0.1)
|
23
|
+
rexml (3.2.5)
|
24
|
+
rspec (3.7.0)
|
25
|
+
rspec-core (~> 3.7.0)
|
26
|
+
rspec-expectations (~> 3.7.0)
|
27
|
+
rspec-mocks (~> 3.7.0)
|
28
|
+
rspec-core (3.7.1)
|
29
|
+
rspec-support (~> 3.7.0)
|
30
|
+
rspec-expectations (3.7.0)
|
31
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
+
rspec-support (~> 3.7.0)
|
33
|
+
rspec-mocks (3.7.0)
|
34
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
35
|
+
rspec-support (~> 3.7.0)
|
36
|
+
rspec-support (3.7.1)
|
37
|
+
rubocop (0.80.1)
|
38
|
+
jaro_winkler (~> 1.5.1)
|
39
|
+
parallel (~> 1.10)
|
40
|
+
parser (>= 2.7.0.1)
|
41
|
+
rainbow (>= 2.2.2, < 4.0)
|
42
|
+
rexml
|
43
|
+
ruby-progressbar (~> 1.7)
|
44
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
45
|
+
rubocop-rspec (1.30.1)
|
46
|
+
rubocop (>= 0.60.0)
|
47
|
+
ruby-progressbar (1.10.1)
|
48
|
+
thor (0.20.3)
|
49
|
+
unicode-display_width (1.6.1)
|
50
|
+
|
51
|
+
PLATFORMS
|
52
|
+
ruby
|
53
|
+
|
54
|
+
DEPENDENCIES
|
55
|
+
bundle-audit
|
56
|
+
bundler (~> 2.3.a)
|
57
|
+
byebug
|
58
|
+
etda_utilities!
|
59
|
+
rake (~> 13.0)
|
60
|
+
rspec (~> 3.0)
|
61
|
+
rubocop
|
62
|
+
rubocop-rspec
|
63
|
+
|
64
|
+
BUNDLED WITH
|
65
|
+
2.3.9
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 jrp22@psu.edu
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# EtdaUtilities
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.com/psu-stewardship/etda_utilities.svg?token=aQpbqAxsm8KshbvyB24o&branch=master)](https://travis-ci.com/psu-stewardship/etda_utilities)
|
4
|
+
|
5
|
+
Common methods used by etda_workflow and etda_explore
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
This Gem isn't published, so you'll have to install it straight from GitHub. It is a public repository, so no private key/token is necessary.
|
10
|
+
|
11
|
+
To install via git, add this line to your applications's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'etda_utilities', git: "https://github.com/psu-stewardship/etda_utilities.git", branch: 'master'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install etda_utilities
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
TODO: Write usage instructions here
|
28
|
+
|
29
|
+
## Development
|
30
|
+
|
31
|
+
To run in ruby console:
|
32
|
+
`irb -Ilib -retda_utilities`
|
33
|
+
|
34
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
35
|
+
|
36
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
37
|
+
|
38
|
+
## Contributing
|
39
|
+
|
40
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/etda_utilities. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
41
|
+
|
42
|
+
## License
|
43
|
+
|
44
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
45
|
+
|
46
|
+
## Code of Conduct
|
47
|
+
|
48
|
+
Everyone interacting in the EtdaUtilities project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/psu-stewardship/etda_utilities/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "etda_utilities"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require "etda_utilities/version"
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "etda_utilities"
|
9
|
+
spec.version = EtdaUtilities::VERSION
|
10
|
+
spec.authors = ["ajk5603@psu.edu"]
|
11
|
+
spec.email = ["ajk5603@psu.edu"]
|
12
|
+
|
13
|
+
spec.summary = 'A gem containing common fuctions for the ETDA applications.'
|
14
|
+
spec.description = 'Contains Partner, .., ..., etc. '
|
15
|
+
spec.homepage = 'https://github.com/psu-stewardship/etda_utilities'
|
16
|
+
spec.license = "MIT"
|
17
|
+
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
+
f.match(%r{^(test|spec|features)/})
|
20
|
+
end
|
21
|
+
spec.bindir = "exe"
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ["lib", "lib/etda_utilities"]
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 2.3.a"
|
26
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
27
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
28
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EtdaUtilities
|
4
|
+
file_path = File.join(File.dirname(__FILE__), 'access_levels_for_partners.yml')
|
5
|
+
CURRENT_PARTNER_ACCESS_LEVELS = YAML.load_file(file_path.to_s)[EtdaUtilities::Partner.current.id]
|
6
|
+
|
7
|
+
class AccessLevel
|
8
|
+
attr_accessor :attributes
|
9
|
+
# attr_accessor :current_access_level
|
10
|
+
# *** IMPORTANT NOTE ***
|
11
|
+
# The order of the keys in this array matter and they should go from least restrictive to most restrictive
|
12
|
+
# This is used in the comparison operation (<=>) below
|
13
|
+
ACCESS_LEVEL_KEYS = ['open_access', 'restricted_to_institution', 'restricted', ''].freeze
|
14
|
+
|
15
|
+
# create instances of each type that can be used
|
16
|
+
# OPEN_ACCESS, RESTRICTED, and RESTRICTED_TO_INSTITUTION (graduate only)
|
17
|
+
class << self
|
18
|
+
ACCESS_LEVEL_KEYS.each do |level|
|
19
|
+
level = 'NO_ACCESS' if level == '' || level.nil?
|
20
|
+
define_method(level.upcase) do
|
21
|
+
new(level)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.partner_access_levels
|
27
|
+
CURRENT_PARTNER_ACCESS_LEVELS
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.paper_access_level_keys
|
31
|
+
ACCESS_LEVEL_KEYS
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.valid_levels
|
35
|
+
paper_access_level_keys # + ['']
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.paper_access_levels
|
39
|
+
paper_access_level_keys.map do |key|
|
40
|
+
level = EtdaUtilities::AccessLevel.new(key)
|
41
|
+
{ type: key, label: level.label, description: level.description }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def initialize(level)
|
46
|
+
# super(submission_attributes, level)
|
47
|
+
@attributes = self.class.partner_access_levels['access_level'][level.to_s] # || 'NO_ACCESS'
|
48
|
+
@current_access_level = verify_access_level(level)
|
49
|
+
end
|
50
|
+
|
51
|
+
attr_reader :current_access_level
|
52
|
+
|
53
|
+
def <=>(other)
|
54
|
+
alevel = other
|
55
|
+
alevel = self.class.new(alevel) unless alevel.instance_of? self.class
|
56
|
+
to_i <=> alevel.to_i
|
57
|
+
end
|
58
|
+
|
59
|
+
def scope
|
60
|
+
self.class.partner_access_levels['access_level']["#{current_access_level}_attr"]['scope'] || 'released_for_publication'
|
61
|
+
end
|
62
|
+
|
63
|
+
def label
|
64
|
+
self.class.partner_access_levels['access_level'][current_access_level] || ''
|
65
|
+
end
|
66
|
+
|
67
|
+
def description
|
68
|
+
return '' if current_access_level == ''
|
69
|
+
|
70
|
+
self.class.partner_access_levels['access_level']["#{current_access_level}_attr"]['description_html']
|
71
|
+
end
|
72
|
+
|
73
|
+
# define the integer value of the item as the index in the access other keys array
|
74
|
+
def to_i
|
75
|
+
self.class.valid_levels.find_index current_access_level
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
def i18n_attr_handle
|
81
|
+
"#{i18n_handle}_attr"
|
82
|
+
end
|
83
|
+
|
84
|
+
def i18n_handle
|
85
|
+
self.class.partner_access_levels['access_level']
|
86
|
+
end
|
87
|
+
|
88
|
+
def verify_access_level(level)
|
89
|
+
EtdaUtilities::AccessLevel::ACCESS_LEVEL_KEYS.include?(level) ? level : ''
|
90
|
+
end
|
91
|
+
|
92
|
+
def method_missing(sym, *args, &block)
|
93
|
+
super
|
94
|
+
rescue NoMethodError
|
95
|
+
name = sym.to_s.sub('?', '')
|
96
|
+
return false if ACCESS_LEVEL_KEYS.include?(name)
|
97
|
+
|
98
|
+
raise
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
graduate:
|
2
|
+
access_level:
|
3
|
+
open_access: Open Access
|
4
|
+
open_access_attr:
|
5
|
+
description_html: Allows free worldwide access to the entire work beginning immediately after degree conferral. Appropriate for the majority of dissertation submissions in immediately fulfilling the requirement for making the work available to the public.
|
6
|
+
scope: released_for_publication
|
7
|
+
restricted_to_institution: 'Restricted (Penn State Only)'
|
8
|
+
restricted_to_institution_attr:
|
9
|
+
description_html: 'Access restricted to individuals having a valid Penn State Access Account, for a period of two years. Allows restricted access of the entire work beginning immediately after degree conferral. At the end of the two-year period, the status will automatically change to Open Access. <i>Intended for use by authors in cases where prior public release of the work may compromise its acceptance for publication.</i>'
|
10
|
+
scope: final_restricted_institution
|
11
|
+
restricted: 'Restricted'
|
12
|
+
restricted_attr:
|
13
|
+
description_html: 'Restricts the entire work for the purpose of filing a patent. At the end of the two-year period, the status will automatically change to Open Access. Selection of this option requires that an invention disclosure (ID) be filed with the Office of Technology Management (OTM) prior to submission of the final thesis/dissertation, and confirmed by OTM.'
|
14
|
+
scope: final_withheld
|
15
|
+
no_access: ''
|
16
|
+
no_access_attr:
|
17
|
+
description_html: ''
|
18
|
+
scope: 'no_access'
|
19
|
+
honors:
|
20
|
+
access_level:
|
21
|
+
open_access: Open Access
|
22
|
+
open_access_attr:
|
23
|
+
description_html: Allows for open access to the body of the thesis. Note:"Withheld" status must be arranged by contacting the Honors College Records Department.
|
24
|
+
scope: released_for_publication
|
25
|
+
restricted_to_institution: 'Restricted (Penn State Only)'
|
26
|
+
restricted_to_institution_attr:
|
27
|
+
description_html: 'Access restricted to individuals having a valid Penn State Access Account, for a period of two years. Allows restricted access of the entire work beginning immediately after degree conferral. At the end of the two-year period, the status will automatically change to Open Access. <i>Intended for use by authors in cases where prior public release of the work may compromise its acceptance for publication.</i>'
|
28
|
+
scope: final_restricted_institution
|
29
|
+
restricted: 'Restricted'
|
30
|
+
restricted_attr:
|
31
|
+
description_html: 'The option selected secures the body of the thesis for a period of two years. Selection of this option requires that an invention disclosure (ID) be filed with the Office of Technology Management (OTM) prior to submission of the final honors thesis and confirmed by OTM. At the end of the two-year period, the work will be released automatically for open access unless a written request is made to extend this option for an additional year. The written request for an extension should be sent 30 days prior to the end of the two-year period to the Honors College Records Department, 10 Schreyer Honors College, The Pennsylvania State University, University Park, PA 16802, or by e-mail to <a href="mailto:SHCAcademics@psu.edu">SHCAcademics@psu.edu</a>. Please note: No one will be able to view your work under this option.'
|
32
|
+
scope: final_withheld
|
33
|
+
no_access: ''
|
34
|
+
no_access_attr:
|
35
|
+
description_html: ''
|
36
|
+
scope: 'no_access'
|
37
|
+
milsch:
|
38
|
+
access_level:
|
39
|
+
open_access: Open Access
|
40
|
+
open_access_attr:
|
41
|
+
description_html: 'Allows free worldwide access to the entire work beginning immediately after degree conferral. Appropriate for the majority of theses submissions in immediately fulling the requirement for making the work available to the public.'
|
42
|
+
scope: released_for_publication
|
43
|
+
restricted_to_institution: 'Restricted (Penn State Only)'
|
44
|
+
restricted_to_institution_attr:
|
45
|
+
description_html: 'Access restricted to individuals having a valid Penn State Access Account, for a period of two years. Allows restricted access of the entire work beginning immediately after degree conferral. At the end of the two-year period, the status will automatically change to Open Access. <i>Intended for use by authors in cases where prior public release of the work may compromise its acceptance for publication.</i>'
|
46
|
+
scope: final_restricted_institution
|
47
|
+
restricted: Restricted
|
48
|
+
restricted_attr:
|
49
|
+
description_html: 'The option selected secures the body of the thesis for a period of two years. Selection of this option requires that an invention disclosure (ID) be filed with the Office of Technology Management (OTM) prior to submission of the final thesis and confirmed by OTM. At the end of the two-year period, the work will be released automatically for open access unless a written request is made to extend this option for an additional year. The written request for an extension should be sent to Millennium Scholars Program, 130 Ritenour Building, University Park, PA 16802 or by email to <a href="mailto:millennium@psu.edu">millennium@psu.edu</a>. Please note: No one will be able to view your work under this option.'
|
50
|
+
scope: final_withheld
|
51
|
+
no_access: ''
|
52
|
+
no_access_attr:
|
53
|
+
description_html: ''
|
54
|
+
scope: 'no_access'
|
55
|
+
sset:
|
56
|
+
access_level:
|
57
|
+
open_access: Open Access
|
58
|
+
open_access_attr:
|
59
|
+
description_html: 'Allows free worldwide access to the entire work beginning immediately after degree conferral. (Most common)'
|
60
|
+
scope: released_for_publication
|
61
|
+
restricted_to_institution: 'Restricted (Penn State Only)'
|
62
|
+
restricted_to_institution_attr:
|
63
|
+
description_html: 'Access restricted to individuals having a valid Penn State Access Account, for a period of two years. Allows restricted access of the entire work beginning immediately after degree conferral. At the end of the two-year period, the status will automatically change to Open Access. <i>Intended for use by authors in cases where prior public release of the work may compromise its acceptance for publication.</i>'
|
64
|
+
scope: final_restricted_institution
|
65
|
+
restricted: Restricted
|
66
|
+
restricted_attr:
|
67
|
+
description_html: 'Restricts the entire work for the purpose of filing a patent. At the end of the two-year period, the status will automatically change to Open Access. Selection of this option requires that an invention disclosure (ID) be filed with the Office of Technology Management (OTM) prior to submission of the final paper , and confirmed by OTM. If no Penn State University funds were utilized in this final paper please enter “NOPSUFUNDS” for the Invention Disclosure Number field below.'
|
68
|
+
scope: final_withheld
|
69
|
+
no_access: ''
|
70
|
+
no_access_attr:
|
71
|
+
description_html: ''
|
72
|
+
scope: 'no_access'
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EtdaUtilities
|
4
|
+
class EtdaFilePaths
|
5
|
+
RESTRICTED_DIR = 'restricted'
|
6
|
+
RESTRICTED_INSTITUTION_DIR = 'restricted_institution'
|
7
|
+
OPEN_DIR = 'open_access'
|
8
|
+
|
9
|
+
def workflow_base_path
|
10
|
+
(defined? WORKFLOW_BASE_PATH) ? WORKFLOW_BASE_PATH : 'tmp/'
|
11
|
+
end
|
12
|
+
|
13
|
+
def explore_base_path
|
14
|
+
(defined? EXPLORE_BASE_PATH) ? EXPLORE_BASE_PATH : 'tmp/'
|
15
|
+
end
|
16
|
+
|
17
|
+
def workflow_upload_final_files_path
|
18
|
+
workflow_base_path + 'final_submission_files/'
|
19
|
+
end
|
20
|
+
|
21
|
+
def workflow_upload_format_review_path
|
22
|
+
workflow_base_path + 'format_review_files/'
|
23
|
+
end
|
24
|
+
|
25
|
+
def workflow_restricted
|
26
|
+
workflow_base_path + RESTRICTED_DIR + '/'
|
27
|
+
end
|
28
|
+
|
29
|
+
def explore_open
|
30
|
+
explore_base_path + OPEN_DIR + '/'
|
31
|
+
end
|
32
|
+
|
33
|
+
def explore_psu_only
|
34
|
+
explore_base_path + RESTRICTED_INSTITUTION_DIR + '/'
|
35
|
+
end
|
36
|
+
|
37
|
+
def detailed_file_path(file_id)
|
38
|
+
str1 = format("%02d", ((file_id.to_i || 0) % 100))
|
39
|
+
str2 = file_id.to_s
|
40
|
+
str1 + '/' + str2 + '/'
|
41
|
+
end
|
42
|
+
|
43
|
+
def explore_download_file_path(file_id, access_level, filename)
|
44
|
+
return nil if file_id.nil? || access_level.empty?
|
45
|
+
|
46
|
+
return nil if access_level == 'restricted'
|
47
|
+
|
48
|
+
return explore_open + detailed_file_path(file_id) + filename if access_level == 'open_access'
|
49
|
+
|
50
|
+
return explore_psu_only + detailed_file_path(file_id) + filename if access_level == 'restricted_to_institution'
|
51
|
+
|
52
|
+
nil
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EtdaUtilities
|
4
|
+
class Hosts
|
5
|
+
def workflow_submit_host(partner, environment = 'prod')
|
6
|
+
host_builder(partner, environment, true)
|
7
|
+
end
|
8
|
+
|
9
|
+
def explore_host(partner, environment = 'prod')
|
10
|
+
host_builder(partner, environment, false)
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def host_builder(partner, environment, is_workflow)
|
16
|
+
return nil if partner.nil?
|
17
|
+
|
18
|
+
return 'localhost' if environment == 'development'
|
19
|
+
|
20
|
+
location_environment = "#{host_application(is_workflow)}-#{environment}" if environment != 'prod'
|
21
|
+
"#{host_prefix(is_workflow)}#{partner_host(partner)}#{location_environment}.libraries.psu.edu"
|
22
|
+
end
|
23
|
+
|
24
|
+
def host_prefix(is_workflow = false)
|
25
|
+
return '' unless is_workflow
|
26
|
+
|
27
|
+
'submit-'
|
28
|
+
end
|
29
|
+
|
30
|
+
def host_application(is_workflow = false)
|
31
|
+
return '' if is_workflow
|
32
|
+
|
33
|
+
'-explore'
|
34
|
+
end
|
35
|
+
|
36
|
+
def partner_host(partner)
|
37
|
+
case partner
|
38
|
+
when 'graduate'
|
39
|
+
"etda"
|
40
|
+
when 'honors'
|
41
|
+
"honors"
|
42
|
+
when 'milsch'
|
43
|
+
"millennium-scholars"
|
44
|
+
when 'sset'
|
45
|
+
"sset"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EtdaUtilities
|
4
|
+
class Partner
|
5
|
+
VALID_IDS = %w[graduate honors milsch sset].freeze
|
6
|
+
|
7
|
+
def self.current
|
8
|
+
new(ENV.fetch('PARTNER'))
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(id)
|
12
|
+
unless VALID_IDS.include?(id)
|
13
|
+
raise ArgumentError, "Unknown partner id #{id.inspect}"
|
14
|
+
end
|
15
|
+
|
16
|
+
@id = id
|
17
|
+
end
|
18
|
+
|
19
|
+
attr_reader :id
|
20
|
+
|
21
|
+
def graduate?
|
22
|
+
id == 'graduate'
|
23
|
+
end
|
24
|
+
|
25
|
+
def honors?
|
26
|
+
id == 'honors'
|
27
|
+
end
|
28
|
+
|
29
|
+
def milsch?
|
30
|
+
id == 'milsch'
|
31
|
+
end
|
32
|
+
|
33
|
+
def sset?
|
34
|
+
id == 'sset'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'etda_utilities/version'
|
4
|
+
|
5
|
+
module EtdaUtilities
|
6
|
+
require 'yaml'
|
7
|
+
require 'etda_utilities/partner'
|
8
|
+
require 'etda_utilities/access_level'
|
9
|
+
require 'etda_utilities/etda_file_paths'
|
10
|
+
require 'etda_utilities/hosts'
|
11
|
+
end
|
metadata
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: etda_utilities
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.16.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ajk5603@psu.edu
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-03-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.3.a
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.3.a
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '13.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '13.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: 'Contains Partner, .., ..., etc. '
|
56
|
+
email:
|
57
|
+
- ajk5603@psu.edu
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".github/workflows/ruby-ci.yml"
|
63
|
+
- ".gitignore"
|
64
|
+
- ".rspec"
|
65
|
+
- ".rubocop.yml"
|
66
|
+
- ".rubocop_todo.yml"
|
67
|
+
- ".ruby-version"
|
68
|
+
- ".travis.yml"
|
69
|
+
- CODEOWNERS
|
70
|
+
- CODE_OF_CONDUCT.md
|
71
|
+
- Gemfile
|
72
|
+
- Gemfile.lock
|
73
|
+
- LICENSE.txt
|
74
|
+
- README.md
|
75
|
+
- Rakefile
|
76
|
+
- bin/console
|
77
|
+
- bin/setup
|
78
|
+
- etda_utilities.gemspec
|
79
|
+
- lib/etda_utilities.rb
|
80
|
+
- lib/etda_utilities/access_level.rb
|
81
|
+
- lib/etda_utilities/access_levels_for_partners.yml
|
82
|
+
- lib/etda_utilities/etda_file_paths.rb
|
83
|
+
- lib/etda_utilities/hosts.rb
|
84
|
+
- lib/etda_utilities/partner.rb
|
85
|
+
- lib/etda_utilities/version.rb
|
86
|
+
homepage: https://github.com/psu-stewardship/etda_utilities
|
87
|
+
licenses:
|
88
|
+
- MIT
|
89
|
+
metadata: {}
|
90
|
+
post_install_message:
|
91
|
+
rdoc_options: []
|
92
|
+
require_paths:
|
93
|
+
- lib
|
94
|
+
- lib/etda_utilities
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
requirements: []
|
106
|
+
rubygems_version: 3.1.6
|
107
|
+
signing_key:
|
108
|
+
specification_version: 4
|
109
|
+
summary: A gem containing common fuctions for the ETDA applications.
|
110
|
+
test_files: []
|