Sha256: 98b7b48470804bc70fe9b942b442a2718a4190630f093808b38920cbbba5871a
Contents?: true
Size: 709 Bytes
Versions: 3
Compression:
Stored size: 709 Bytes
Contents
require 'smithy/dragonfly/asset_helper' require 'smithy/dragonfly/remote_data_store' module Smithy module Dragonfly def self.resize_url(source, resize_string) file = nil if source.is_a?(String) source.strip! if source =~ /^http/ file = self.app.fetch_url(source) else file = self.app.fetch_file(File.join('public', source)) end elsif source.respond_to?(:url) # dragonfly uploader file = source else Smithy.log :error, "Unable to resize on the fly: #{source.inspect}" return end file.process(:thumb, resize_string).url end def self.app ::Dragonfly[:files] end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
smithycms-0.0.3 | lib/smithy/dragonfly.rb |
smithycms-0.0.2 | lib/smithy/dragonfly.rb |
smithycms-0.0.1 | lib/smithy/dragonfly.rb |