moul/node-gitlab — pull request #24 by aheber (2014-04-25 15:44:34+00:00)
Title: Change Repository.listTree to accept params, added showFile

Generated with CoffeeScript 1.7.1 instead of 1.6.3, caused a lot of file changes. Feel free to pull the important files out into another commit. The key changes are in ProjectRepository.coffee/.js

# === Tree
listTree: (projectId, params = {}, fn = null) =>
@debug "Projects::listTree()"
if 'function' is typeof(params)
fn = params
params = {}
@get "projects/#{parseInt projectId}/repository/tree", params, (data) => fn data if fn

# == Files
showFile: (projectId, params, fn = null) =>
@debug "Projects::showFile()", params
if params.file_path and params.ref
@post "projects/#{parseInt params.projectId}/repository/files", params, (data) => fn data if fn