Created
June 2, 2009 20:35
-
-
Save luislavena/122561 to your computer and use it in GitHub Desktop.
Default Paperclip configuration for projects
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
# Load config/paperclip.yml settings | |
if paperclip_cfg = YAML.load_file("#{Rails.root}/config/paperclip.yml")[Rails.env] | |
paperclip_cfg.symbolize_keys! | |
command_path = paperclip_cfg.delete(:command_path) | |
# Replace Attachment defaults with configuration ones | |
Paperclip::Attachment.default_options.merge!(paperclip_cfg) | |
# Adjust ImageMagick path to work with Passenger | |
Paperclip.options[:command_path] = command_path | |
end | |
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
common: &local_settings | |
storage: :filesystem | |
url: "/assets/:class/:attachment/:id_partition/:basename_:style.:extension" | |
command_path: /opt/local/bin | |
s3_amazon: &s3_settings | |
<<: *local_settings | |
storage: :s3 | |
s3_credentials: config/s3.yml | |
path: ":class/:attachment/:id_partition/:basename_:style.:extension" | |
url: ":s3_domain_url" | |
cloudfront: &cloud_settings | |
<<: *s3_settings | |
url: ":s3_alias_url" | |
development: | |
<<: *local_settings | |
staging: | |
<<: *cloud_settings | |
bucket: assets-bucket | |
s3_host_alias: assets.domain.com | |
command_path: /usr/bin | |
production: | |
<<: *local_settings | |
command_path: /usr/bin | |
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
access_key_id: ... | |
secret_access_key: ... | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment