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.
81 82 83 |
# File 'lib/s3ranger/sync.rb', line 81 def initialize source @source = source end |
Instance Attribute Details
#source ⇒ Object
Returns the value of attribute source.
79 80 81 |
# File 'lib/s3ranger/sync.rb', line 79 def source @source end |
Instance Method Details
#list_files ⇒ Object
85 86 87 88 89 90 91 92 93 |
# File 'lib/s3ranger/sync.rb', line 85 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 |