Module: Resources::Project::FileMgt

Included in:
Onesky::Project
Defined in:
lib/onesky/resources/project/file_mgt.rb

Instance Method Summary collapse

Instance Method Details

#delete_file(params) ⇒ Object



19
20
21
# File 'lib/onesky/resources/project/file_mgt.rb', line 19

def delete_file(params)
  delete("#{project_path}/files", params)
end

#list_fileObject



5
6
7
# File 'lib/onesky/resources/project/file_mgt.rb', line 5

def list_file
  get("#{project_path}/files")
end

#upload_file(params) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/onesky/resources/project/file_mgt.rb', line 9

def upload_file(params)
  file = params[:file]
  if file.is_a?(String)
    raise IOError, 'File does not exist' unless File.exists?(file)
    params[:file] = File.new(file, 'rt')
  end

  post_multipart("#{project_path}/files", params)
end