-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adds file blacklist #6
Conversation
nick-benoit14
commented
Dec 5, 2016
- Adds file blacklist so only desired files are uploaded
@@ -61,12 +69,19 @@ def self.iterate_xml(resources, zip_file) | |||
resources_array - ["", nil] | |||
end | |||
|
|||
def self.black_listed?(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider?
def self.black_listed?(name)
!FILE_BLACK_LIST.include? name
end
def self.iterate_files(zip_file) | ||
resources_array = [] | ||
zip_file.entries.each do |entry| | ||
filtered_entries = zip_file.entries.select { |e| black_listed? e.name } | ||
filtered_entries.each do |entry| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's refactor this too.
def self.iterate_files(zip_file)
zip_file.
entries.
select { |entry| black_listed? entry.name }.
map { |entry| BlacklightFile.new(entry) }
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!