Created
February 27, 2019 00:27
-
-
Save swarley/7c18896c36918fb1b92dd38950f94d78 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if file.respond_to?(:read) | |
if spoiler | |
filename ||= File.basename(file.path) | |
filename = 'SPOILER_' + filename unless filename.start_with? 'SPOILER_' | |
end | |
# https://github.com/rest-client/rest-client/blob/v2.0.2/lib/restclient/payload.rb#L160 | |
file.define_singleton_method(:original_filename) { filename } if filename | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment