Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ build/

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

# for old fashioned emacs users like me
*~
12 changes: 10 additions & 2 deletions lib/dropbox/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,17 @@ def get_thumbnail(path, format='jpeg', size='w64h64')
# Get the contents of a folder.
#
# @param [String] path
# @param [Hash] options
# @option (see #list_folder)
# @return [Array<Dropbox::Metadata>]
def list_folder(path)
resp = request('/files/list_folder', path: path)
def list_folder(path, options={})
options[:path] = path
options[:recursive] ||= false
options[:include_deleted] ||= false
options[:include_media_info] ||= false
options[:include_has_explicit_shared_members] ||= false
options[:include_mounted_folders] ||= true
resp = request('/files/list_folder', options)
resp['entries'].map { |e| parse_tagged_response(e) }
end

Expand Down
4 changes: 3 additions & 1 deletion lib/dropbox/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def initialize(attrs={})

# Contains the metadata (but not contents) of a file.
class FileMetadata < Metadata
attr_reader :id, :client_modified, :server_modified, :rev, :size
attr_reader :id, :client_modified, :server_modified, :rev,
:size, :content_hash

def initialize(attrs={})
@id = attrs.delete('id')
Expand All @@ -24,6 +25,7 @@ def initialize(attrs={})
@server_modified = Time.parse(attrs.delete('server_modified'))
@rev = attrs.delete('rev')
@size = attrs.delete('size')
@content_hash = attrs.delete('content_hash')
super(attrs)
end

Expand Down