Permalink
Browse files

Adding hook for specifying the asset_prefix path in the cloud

  • Loading branch information...
1 parent 268eef7 commit 00ad4fc6917dc467a0425e06ee107332f39bfc11 David Pitman committed Mar 3, 2012
Showing with 4 additions and 1 deletion.
  1. +3 −0 lib/asset_sync/config.rb
  2. +1 −1 lib/asset_sync/storage.rb
View
@@ -9,6 +9,7 @@ class Invalid < StandardError; end
attr_accessor :gzip_compression
attr_accessor :manifest
attr_accessor :fail_silently
+ attr_accessor :fog_asset_prefix
# FOG configuration
attr_accessor :fog_provider # Currently Supported ['AWS', 'Rackspace']
@@ -37,6 +38,7 @@ def initialize
self.gzip_compression = false
self.manifest = false
self.fail_silently = false
+ self.fog_assets_prefix = assets_prefix
load_yml! if yml_exists?
end
@@ -96,6 +98,7 @@ def load_yml!
self.gzip_compression = yml["gzip_compression"] if yml.has_key?("gzip_compression")
self.manifest = yml["manifest"] if yml.has_key?("manifest")
self.fail_silently = yml["fail_silently"] if yml.has_key?("fail_silently")
+ self.fog_assets_prefix = yml["fog_assets_prefix"] if yml.has_key?("fog_assets_prefix")
# TODO deprecate the other old style config settings. FML.
self.aws_access_key_id = yml["aws_access_key"] if yml.has_key?("aws_access_key")
@@ -15,7 +15,7 @@ def connection
def bucket
# fixes: https://github.com/rumblelabs/asset_sync/issues/18
- @bucket ||= connection.directories.get(self.config.fog_directory, :prefix => self.config.assets_prefix)
+ @bucket ||= connection.directories.get(self.config.fog_directory, :prefix => self.config.fog_assets_prefix)
end
def keep_existing_remote_files?

0 comments on commit 00ad4fc

Please sign in to comment.