Class: Vx::ServiceConnector::GitlabV5::Files

Inherits:
Struct
  • Object
show all
Defined in:
lib/vx/service_connector/gitlab_v5/files.rb

Direct Known Subclasses

Vx::ServiceConnector::GitlabV6::Files

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#repoObject

Returns the value of attribute repo

Returns:

  • (Object)

    the current value of repo



6
7
8
# File 'lib/vx/service_connector/gitlab_v5/files.rb', line 6

def repo
  @repo
end

#sessionObject

Returns the value of attribute session

Returns:

  • (Object)

    the current value of session



6
7
8
# File 'lib/vx/service_connector/gitlab_v5/files.rb', line 6

def session
  @session
end

Instance Method Details

#get(sha, path) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/vx/service_connector/gitlab_v5/files.rb', line 8

def get(sha, path)
  begin
    session.get("/projects/#{repo.id}/repository/commits/#{sha}/blob", filepath: path)
  rescue RequestError => e
    $stderr.puts "ERROR: #{e.inspect}"
    nil
  end
end