Skip to content

Commit 348bcfa

Browse files
committed
add explore path for liberal arts embargo
1 parent 38bbeff commit 348bcfa

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/etda_utilities/etda_file_paths.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module EtdaUtilities
44
class EtdaFilePaths
55
RESTRICTED_DIR = 'restricted'
66
RESTRICTED_INSTITUTION_DIR = 'restricted_institution'
7+
RESTRICTED_LIBERAL_ARTS_DIR = 'restricted_liberal_arts'
78
OPEN_DIR = 'open_access'
89

910
def workflow_base_path
@@ -34,6 +35,10 @@ def explore_psu_only
3435
"#{explore_base_path}#{RESTRICTED_INSTITUTION_DIR}/"
3536
end
3637

38+
def explore_liberal_arts_only
39+
"#{explore_base_path}#{RESTRICTED_LIBERAL_ARTS_DIR}/"
40+
end
41+
3742
def detailed_file_path(file_id)
3843
str1 = format("%02d", ((file_id.to_i || 0) % 100))
3944
str2 = file_id.to_s
@@ -47,7 +52,9 @@ def explore_download_file_path(file_id, access_level, filename)
4752

4853
return explore_open + detailed_file_path(file_id) + filename if access_level == 'open_access'
4954

50-
return explore_psu_only + detailed_file_path(file_id) + filename if ['restricted_to_institution', 'restricted_liberal_arts'].include?(access_level)
55+
return explore_psu_only + detailed_file_path(file_id) + filename if access_level == 'restricted_to_institution'
56+
57+
return explore_liberal_arts_only + detailed_file_path(file_id) + filename if access_level == 'restricted_liberal_arts'
5158

5259
nil
5360
end

spec/lib/etda_utilities_etda_file_paths_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
it 'returns a path for restricted_liberal_arts records' do
7676
access_level = 'restricted_liberal_arts'
77-
expect(subject.explore_download_file_path(file_id, access_level, filename)).to eq('tmp/restricted_institution/45/345/myfile.pdf')
77+
expect(subject.explore_download_file_path(file_id, access_level, filename)).to eq('tmp/restricted_liberal_arts/45/345/myfile.pdf')
7878
end
7979

8080
it 'returns a path for open_access records' do

0 commit comments

Comments
 (0)