Created
May 7, 2015 14:19
-
-
Save dimroc/eeb519c36152dbc133ae to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class FastlyAssetsProvider | |
| include Roadie::AssetProvider | |
| def find_stylesheet(name) | |
| Rails.logger.info("## FastlyAssetsProvider retrieving asset named: #{name}") | |
| asset_host = Rails.application.config.action_mailer.asset_host | |
| return nil unless asset_host.present? | |
| uri = URI(name) | |
| uri.scheme = 'https' | |
| response = URI.parse(uri.to_s).read | |
| Roadie::Stylesheet.new(name, response) | |
| rescue OpenURI::HTTPError | |
| rescue NoMethodError | |
| nil | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment