Module: Gitlab::Client::Wikis
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/wikis.rb
Overview
Defines methods related to wikis.
Instance Method Summary collapse
-
#create_wiki(project, title, content, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new wiki page for the given repository with the given title, slug, and content.
-
#delete_wiki(project, slug) ⇒ Gitlab::ObjectifiedHash
Deletes a wiki page with a given slug.
-
#update_wiki(project, slug, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates an existing wiki page.
-
#wiki(project, slug) ⇒ Gitlab::ObjectifiedHash
Get a wiki page for a given project.
-
#wikis(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Get all wiki pages for a given project.
Instance Method Details
#create_wiki(project, title, content, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new wiki page for the given repository with the given title, slug, and content.
45 46 47 48 |
# File 'lib/gitlab/client/wikis.rb', line 45 def create_wiki(project, title, content, = {}) body = { content: content, title: title }.merge() post("/projects/#{url_encode project}/wikis", body: body) end |
#delete_wiki(project, slug) ⇒ Gitlab::ObjectifiedHash
Deletes a wiki page with a given slug.
75 76 77 |
# File 'lib/gitlab/client/wikis.rb', line 75 def delete_wiki(project, slug) delete("/projects/#{url_encode project}/wikis/#{slug}") end |
#update_wiki(project, slug, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates an existing wiki page. At least one parameter is required to update the wiki page.
63 64 65 |
# File 'lib/gitlab/client/wikis.rb', line 63 def update_wiki(project, slug, = {}) put("/projects/#{url_encode project}/wikis/#{slug}", body: ) end |
#wiki(project, slug) ⇒ Gitlab::ObjectifiedHash
Get a wiki page for a given project.
29 30 31 |
# File 'lib/gitlab/client/wikis.rb', line 29 def wiki(project, slug) get("/projects/#{url_encode project}/wikis/#{slug}") end |
#wikis(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Get all wiki pages for a given project.
17 18 19 |
# File 'lib/gitlab/client/wikis.rb', line 17 def wikis(project, = {}) get("/projects/#{url_encode project}/wikis", query: ) end |