Skip to content

Commit

Permalink
refactoring get_local_files method
Browse files Browse the repository at this point in the history
  • Loading branch information
d-tasaki committed Dec 15, 2017
1 parent 1050326 commit efd7e41
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/asset_sync/storage.rb
Expand Up @@ -58,7 +58,7 @@ def files_to_invalidate
self.config.invalidate.map { |filename| File.join("/", self.config.assets_prefix, filename) }
end

def get_local_files
def get_asset_files_from_manifest
if self.config.manifest
if ActionView::Base.respond_to?(:assets_manifest)
log "Using: Rails 4.0 manifest access"
Expand All @@ -80,6 +80,13 @@ def get_local_files
log "Warning: Manifest could not be found"
end
end
end

def get_local_files
if from_manifest = get_asset_files_from_manifest
return from_manifest
end

log "Using: Directory Search of #{path}/#{self.config.assets_prefix}"
Dir.chdir(path) do
to_load = self.config.assets_prefix.present? ? "#{self.config.assets_prefix}/**/**" : '**/**'
Expand Down

0 comments on commit efd7e41

Please sign in to comment.