Class: S3Ranger::LocalDirectory
- Inherits:
-
Object
- Object
- S3Ranger::LocalDirectory
- Defined in:
- lib/s3ranger/sync.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(source) ⇒ LocalDirectory
constructor
A new instance of LocalDirectory.
- #list_files ⇒ Object
Constructor Details
#initialize(source) ⇒ LocalDirectory
Returns a new instance of LocalDirectory.
107 108 109 |
# File 'lib/s3ranger/sync.rb', line 107 def initialize source @source = source end |
Instance Attribute Details
#source ⇒ Object
Returns the value of attribute source.
105 106 107 |
# File 'lib/s3ranger/sync.rb', line 105 def source @source end |
Instance Method Details
#list_files ⇒ Object
111 112 113 114 115 116 117 118 119 |
# File 'lib/s3ranger/sync.rb', line 111 def list_files Dir["#{@source}/**/*"].collect { |file| unless File.directory? file file = Pathname.new(file).cleanpath.to_s file_name = file.gsub(/^#{@source}\/?/, '') Node.new @source, file_name, File.stat(file).size end }.compact end |