Class: Backend::Api::Sources::Project
- Inherits:
-
Object
- Object
- Backend::Api::Sources::Project
- Extended by:
- ConnectionHelper
- Defined in:
- api/sources/project.rb
Overview
Class that connect to endpoints related to projects
Class Method Summary collapse
-
.attributes(project, revision) ⇒ String
Returns the attributes for the project.
-
.key_info(project) ⇒ String
Returns the KeyInfo file for the project.
-
.meta(project, options = {}) ⇒ String
Returns the meta file from a project.
-
.move(source, target) ⇒ String
Moves the source project to the target.
-
.patchinfo(project) ⇒ String
Returns the patchinfo for the project.
-
.revisions(project) ⇒ String
Returns the revisions (mrev) list for a project.
-
.write_attributes(project, user, content, comment) ⇒ String
Writes the xml for attributes.
-
.write_configuration(project, configuration) ⇒ String
Writes a Project configuration.
Class Method Details
.attributes(project, revision) ⇒ String
Returns the attributes for the project
12 13 14 15 16 |
# File 'api/sources/project.rb', line 12 def self.attributes(project, revision) params = { meta: 1 } params[:rev] = revision if revision get(["/source/:project/_project/_attribute", project], params: params) end |
.key_info(project) ⇒ String
Returns the KeyInfo file for the project
54 55 56 |
# File 'api/sources/project.rb', line 54 def self.key_info(project) get(["/source/:project/_keyinfo", project], params: { withsslcert: 1, donotcreatecert: 1 }) end |
.meta(project, options = {}) ⇒ String
Returns the meta file from a project
39 40 41 |
# File 'api/sources/project.rb', line 39 def self.(project, = {}) get(["/source/:project/_project/_meta", project], params: , accepted: [:revision, :deleted], rename: { revision: :rev }) end |
.move(source, target) ⇒ String
Moves the source project to the target
69 70 71 |
# File 'api/sources/project.rb', line 69 def self.move(source, target) post(["/source/:project", target], params: { cmd: :move, oproject: source }) end |
.patchinfo(project) ⇒ String
Returns the patchinfo for the project
61 62 63 |
# File 'api/sources/project.rb', line 61 def self.patchinfo(project) get(["/source/:project/_patchinfo", project]) end |
.revisions(project) ⇒ String
Returns the revisions (mrev) list for a project
30 31 32 |
# File 'api/sources/project.rb', line 30 def self.revisions(project) get(["/source/:project/_project/_history", project], params: { meta: 1, deleted: 1 }) end |
.write_attributes(project, user, content, comment) ⇒ String
Writes the xml for attributes
21 22 23 24 25 |
# File 'api/sources/project.rb', line 21 def self.write_attributes(project, user, content, comment) params = { meta: 1, user: user } params[:comment] = comment if comment put(["/source/:project/_project/_attribute", project], data: content, params: params) end |
.write_configuration(project, configuration) ⇒ String
Writes a Project configuration
47 48 49 |
# File 'api/sources/project.rb', line 47 def self.write_configuration(project, configuration) put(["/source/:project/_config", project], data: configuration) end |