Method: LabClient::Files#show

Defined in:
lib/labclient/files/show.rb

#show(project_id, file_path, ref = :main, kind = nil) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/labclient/files/show.rb', line 34

def show(project_id, file_path, ref = :main, kind = nil)
  kind = case kind
         when :raw
           '/raw'
         when :blame
           '/blame'
         end
  # GET /projects/:id/repository/files/:file_path

  project_id = format_id(project_id)

  # Path Name Encoding
  file_path = CGI.escape(file_path)

  client.request(:get, "projects/#{project_id}/repository/files/#{file_path}#{kind}", LabFile, ref: ref)
end