Module: WrataApi::FileListMethods

Included in:
WrataApi
Defined in:
lib/wrata_api/file_tree.rb

Overview

Methods to work with file tree

Instance Method Summary collapse

Instance Method Details

#file_list(project, ref = 'master') ⇒ Array<String>

Return list of files in specific project

Parameters:

  • project (String)

    name of project

  • ref (String) (defaults to: 'master')

    branch or hash of commit to get list of files

Returns:

  • (Array<String>)

    list of files



10
11
12
13
14
15
16
17
18
# File 'lib/wrata_api/file_tree.rb', line 10

def file_list(project, ref = 'master')
  uri = URI.parse("#{@uri}/runner/file_tree")
  body = {
    'flatten' => true,
    'project' => project,
    'refs' => ref
  }
  perform_get(uri, body)
end