Class: SyncFog::SyncFogAssets

Inherits:
Object
  • Object
show all
Defined in:
lib/sync_fog/sync_fog_assets.rb

Instance Method Summary collapse

Constructor Details

#initializeSyncFogAssets

Returns a new instance of SyncFogAssets.



9
10
11
# File 'lib/sync_fog/sync_fog_assets.rb', line 9

def initialize

end

Instance Method Details

#list(dir = ".") ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/sync_fog/sync_fog_assets.rb', line 13

def list(dir=".")

  root_path = Pathname.new File.expand_path('..',dir) # one dir up
  files = []

  Dir.glob("#{dir}/**/*") do |file|
    path = Pathname.new file
    files << path.relative_path_from(root_path) unless %w(. ..).include?(file)
  end

  files
end