gitlab_ruby 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +2 -0
- data/.travis.yml +8 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +145 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/gitlab_ruby.gemspec +32 -0
- data/lib/gitlab_ruby.rb +16 -0
- data/lib/gitlab_ruby/api_errors.rb +59 -0
- data/lib/gitlab_ruby/api_object.rb +25 -0
- data/lib/gitlab_ruby/client.rb +79 -0
- data/lib/gitlab_ruby/errors.rb +7 -0
- data/lib/gitlab_ruby/helpers/query_chain.rb +15 -0
- data/lib/gitlab_ruby/query_chain.rb +44 -0
- data/lib/gitlab_ruby/routes_table_no_verb.csv +351 -0
- data/lib/gitlab_ruby/version.rb +3 -0
- metadata +176 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 90821189da268f6135e016d179b18e8a735193e5
|
4
|
+
data.tar.gz: 873b28591624edb594704eb49656e958eac20a8b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 483d4b7cf43cae4847b1a1dc6bf53023007df4ddfbd9b387f16090128f6c5bae200cb2624c3213c729b6a18071cfd507d4254df06e6a99df1c4f9a2b4572e01c
|
7
|
+
data.tar.gz: cdf1b08e6cce35ea27578edf31d19e66c0bcc3d5dbe796e966ec3dcdd0b80add053ba555703bbbe86767c311804a6cdd507e5fa6a69abc588691bde10474996e
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at tm89lee@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 TODO: Write your name
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/tmlee/gitlab_ruby.svg?branch=master)](https://travis-ci.org/tmlee/gitlab_ruby)
|
2
|
+
|
3
|
+
# GitlabRuby
|
4
|
+
|
5
|
+
GitlabRuby is a Gitlab library for Ruby supporting the [Gitlab API](https://docs.gitlab.com/ce/api/README.html).
|
6
|
+
GitlabRuby aims to be adaptive to the Gitlab API and simple to use.
|
7
|
+
|
8
|
+
* Adaptive: Gitlab project is open sourced and new features are added frequently. GitlabRuby should be able to automatically parse all endpoints from that project.
|
9
|
+
* Simple: GitlabRuby should be simple that you will only have to refer to the Gitlab API official documentation to make any calls you intended to.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Install from rubygems:
|
14
|
+
|
15
|
+
```
|
16
|
+
gem install gitlab_ruby
|
17
|
+
```
|
18
|
+
|
19
|
+
Or add this line to your application's Gemfile:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
gem 'gitlab_ruby'
|
23
|
+
```
|
24
|
+
|
25
|
+
And then execute:
|
26
|
+
|
27
|
+
$ bundle
|
28
|
+
|
29
|
+
## Getting Started
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
API_KEY = 'USER_TOKEN' # OBTAIN API KEY FROM GITLAB.com
|
33
|
+
client = GitlabRuby::Client.new(token: API_KEY, version: 'v4')
|
34
|
+
projects = client.get.projects.execute # List all projects
|
35
|
+
|
36
|
+
# Returned API objects are accessible like any Ruby object
|
37
|
+
projects.first.name
|
38
|
+
projects.last.description
|
39
|
+
```
|
40
|
+
|
41
|
+
## Usage
|
42
|
+
|
43
|
+
#### Configurations
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
client = GitlabRuby::Client.new(
|
47
|
+
token: API_KEY, # user's private token or OAuth2 access token
|
48
|
+
version: 'v4', # choose API version, default: v4
|
49
|
+
endpoint: 'https://example.com/api/' # Custom endpoint for self-hosted Gitlab, default: https://gitlab.com/api/
|
50
|
+
)
|
51
|
+
```
|
52
|
+
|
53
|
+
#### Interacting with Gitlab API
|
54
|
+
|
55
|
+
GitlabRuby aims to allow interaction with the Gitlab API using method chaining syntax, while also adhering closely to the way the Gitlab API is structured. You should only need to refer to the [Gitlab API documentation](https://docs.gitlab.com/ce/api/README.html) when using GitlabRuby.
|
56
|
+
|
57
|
+
#### How it works
|
58
|
+
|
59
|
+
Assume the following API endpoint
|
60
|
+
```
|
61
|
+
POST /projects/:id/share
|
62
|
+
|
63
|
+
Attribute Type Required Description
|
64
|
+
id integer/string yes The ID of the project or NAMESPACE/PROJECT_NAME
|
65
|
+
group_id integer yes The ID of the group to share with
|
66
|
+
group_access integer yes The permissions level to grant the group
|
67
|
+
expires_at string no Share expiration date in ISO 8601 format: 2016-09-26
|
68
|
+
```
|
69
|
+
|
70
|
+
You would call it with
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
client.post.projects.id(project_id).share.execute(
|
74
|
+
group_id: group_id,
|
75
|
+
group_access: access
|
76
|
+
)
|
77
|
+
```
|
78
|
+
|
79
|
+
Start the query with a `get`, `post`, `put`, or `delete`.
|
80
|
+
|
81
|
+
Pass any additional parameters in `execute` to make the API call.
|
82
|
+
|
83
|
+
## More Examples
|
84
|
+
|
85
|
+
#### [List Projects](https://docs.gitlab.com/ce/api/projects.html#projects)
|
86
|
+
```
|
87
|
+
GET /projects
|
88
|
+
```
|
89
|
+
Translates to
|
90
|
+
```ruby
|
91
|
+
client.get.projects.execute
|
92
|
+
```
|
93
|
+
|
94
|
+
#### [Get Single Project](https://docs.gitlab.com/ce/api/projects.html##get-single-project)
|
95
|
+
```
|
96
|
+
GET /projects/:id
|
97
|
+
|
98
|
+
# /projects/'gitlab-org%2Fgitlab-ce'
|
99
|
+
```
|
100
|
+
Translates to
|
101
|
+
```ruby
|
102
|
+
client.get.projects.id('gitlab-org%2Fgitlab-ce').execute
|
103
|
+
```
|
104
|
+
URL parameters works like calling a method
|
105
|
+
|
106
|
+
#### [Create Project](https://docs.gitlab.com/ce/api/projects.html#create-project)
|
107
|
+
```
|
108
|
+
POST /projects
|
109
|
+
|
110
|
+
# with params
|
111
|
+
{
|
112
|
+
name: 'New Gitlab Project'
|
113
|
+
}
|
114
|
+
```
|
115
|
+
Translates to
|
116
|
+
```ruby
|
117
|
+
client.post.projects.execute(name: 'New Gitlab Project')
|
118
|
+
```
|
119
|
+
Query parameters are passed into the `execute` method
|
120
|
+
|
121
|
+
#### Complete API
|
122
|
+
|
123
|
+
Refer to the complete [https://docs.gitlab.com/ce/api/](documentation) endpoints.
|
124
|
+
|
125
|
+
## Development
|
126
|
+
|
127
|
+
Since the [Gitlab](https://gitlab.com/gitlab-org/gitlab-ce) codebase is open source, GitlabRuby attempts to use Ruby metaprogramming to generate an intuitive API library from the list of possible endpoints which Gitlab supports.
|
128
|
+
|
129
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
130
|
+
|
131
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
132
|
+
|
133
|
+
## Contributing
|
134
|
+
|
135
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/gitlab_ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
136
|
+
|
137
|
+
## TODO
|
138
|
+
[] Script to automatically update API routes from Gitlab CE project
|
139
|
+
[] Support sudo
|
140
|
+
[] Support pagination
|
141
|
+
|
142
|
+
## License
|
143
|
+
|
144
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
145
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "gitlab_ruby"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/gitlab_ruby.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'gitlab_ruby/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "gitlab_ruby"
|
8
|
+
spec.version = GitlabRuby::VERSION
|
9
|
+
spec.authors = ["TM Lee"]
|
10
|
+
spec.email = ["tm89lee@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Ruby wrapper for the Gitlab API (Supports V3 & V4)}
|
13
|
+
spec.description = %q{Interact with Gitlab API on Ruby with method chaining}
|
14
|
+
spec.homepage = "https://github.com/tmlee/gitlab_ruby"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_dependency "faraday", "~> 0.11"
|
25
|
+
spec.add_dependency "mustermann", "~> 1.0"
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.14"
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
29
|
+
spec.add_development_dependency "vcr", "~> 3.0"
|
30
|
+
spec.add_development_dependency "webmock", "~> 2.3"
|
31
|
+
spec.add_development_dependency "byebug"
|
32
|
+
end
|
data/lib/gitlab_ruby.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'gitlab_ruby/version'
|
2
|
+
require 'gitlab_ruby/query_chain'
|
3
|
+
require 'gitlab_ruby/client'
|
4
|
+
require 'gitlab_ruby/api_object'
|
5
|
+
require 'gitlab_ruby/errors'
|
6
|
+
require 'gitlab_ruby/api_errors'
|
7
|
+
require 'gitlab_ruby/helpers/query_chain'
|
8
|
+
require 'faraday'
|
9
|
+
require 'json'
|
10
|
+
require 'csv'
|
11
|
+
require 'mustermann'
|
12
|
+
|
13
|
+
module GitlabRuby
|
14
|
+
end
|
15
|
+
|
16
|
+
GitlabRuby::QueryChain.generate_methods
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module GitlabRuby
|
2
|
+
def self.format_error(resp)
|
3
|
+
resp.body
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.check_response_status(resp)
|
7
|
+
if resp.body
|
8
|
+
case resp.status
|
9
|
+
when 400 then raise BadRequestError, format_error(resp)
|
10
|
+
when 401 then raise UnauthorizedError, format_error(resp)
|
11
|
+
when 403 then raise ForbiddenError, format_error(resp)
|
12
|
+
when 404 then raise NotFoundError, format_error(resp)
|
13
|
+
when 405 then raise MethodNotAllowedError, format_error(resp)
|
14
|
+
when 409 then raise ConflictError, format_error(resp)
|
15
|
+
when 422 then raise UnprocessableError, format_error(resp)
|
16
|
+
when 500 then raise ServerError, format_error(resp)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
if resp.status > 400
|
21
|
+
raise APIError, "[#{resp.status}] #{resp.body}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class APIError < RuntimeError
|
26
|
+
end
|
27
|
+
|
28
|
+
# Status 400
|
29
|
+
class BadRequestError < APIError
|
30
|
+
end
|
31
|
+
|
32
|
+
# Status 401
|
33
|
+
class UnauthorizedError < APIError
|
34
|
+
end
|
35
|
+
|
36
|
+
# Status 403
|
37
|
+
class ForbiddenError < APIError
|
38
|
+
end
|
39
|
+
|
40
|
+
# Status 404
|
41
|
+
class NotFoundError < APIError
|
42
|
+
end
|
43
|
+
|
44
|
+
# Status 405
|
45
|
+
class MethodNotAllowedError < APIError
|
46
|
+
end
|
47
|
+
|
48
|
+
# Status 409
|
49
|
+
class ConflictError < APIError
|
50
|
+
end
|
51
|
+
|
52
|
+
# Status 422
|
53
|
+
class UnprocessableError < APIError
|
54
|
+
end
|
55
|
+
|
56
|
+
# Status 500
|
57
|
+
class ServerError < APIError
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module GitlabRuby
|
2
|
+
class APIObject < Hash
|
3
|
+
def initialize(data)
|
4
|
+
super()
|
5
|
+
data.each { |key, val| self[key] = val } if data.is_a?(Hash)
|
6
|
+
end
|
7
|
+
|
8
|
+
def format(val)
|
9
|
+
return if val.nil?
|
10
|
+
if val.class == Hash
|
11
|
+
APIObject.new(val)
|
12
|
+
else
|
13
|
+
val
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def method_missing(method, *args, &blk)
|
18
|
+
format(self[method.to_s]) || super
|
19
|
+
end
|
20
|
+
|
21
|
+
def respond_to_missing?(method, include_all = false)
|
22
|
+
key?(method.to_s) || super
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
module GitlabRuby
|
2
|
+
class Client
|
3
|
+
BASE_URL = "https://gitlab.com/api/"
|
4
|
+
LATEST_VERSION = 'v4'
|
5
|
+
|
6
|
+
def initialize(params={})
|
7
|
+
@token = params[:token]
|
8
|
+
@urlstring = ""
|
9
|
+
@endpoint = params[:endpoint] || BASE_URL
|
10
|
+
@version = params[:version] || LATEST_VERSION
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.debug
|
14
|
+
@debug ||= false
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.debug=(v)
|
18
|
+
@debug = !!v
|
19
|
+
end
|
20
|
+
|
21
|
+
def put
|
22
|
+
GitlabRuby::QueryChain.new(client: self, verb: :put)
|
23
|
+
end
|
24
|
+
|
25
|
+
def post
|
26
|
+
GitlabRuby::QueryChain.new(client: self, verb: :post)
|
27
|
+
end
|
28
|
+
|
29
|
+
def get
|
30
|
+
GitlabRuby::QueryChain.new(client: self, verb: :get)
|
31
|
+
end
|
32
|
+
|
33
|
+
def delete
|
34
|
+
GitlabRuby::QueryChain.new(client: self, verb: :delete)
|
35
|
+
end
|
36
|
+
|
37
|
+
def api_call(method_name, options, verb=:get)
|
38
|
+
response = connection(method_name, options, verb)
|
39
|
+
puts response.inspect if self.class.debug
|
40
|
+
result = parse_response(response)
|
41
|
+
if result.is_a? Array
|
42
|
+
result.map { |item| APIObject.new(item) }
|
43
|
+
elsif result.is_a? Hash
|
44
|
+
APIObject.new(result)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def versioned_url
|
51
|
+
BASE_URL + @version + "/"
|
52
|
+
end
|
53
|
+
|
54
|
+
def parse_response(response)
|
55
|
+
if response.status.to_i >= 400
|
56
|
+
GitlabRuby::check_response_status(response)
|
57
|
+
else
|
58
|
+
JSON.parse(response.body)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def connection(method_name, options, verb)
|
63
|
+
conn = Faraday.new(url: versioned_url) do |faraday|
|
64
|
+
faraday.request :url_encoded
|
65
|
+
faraday.response(:logger) if self.class.debug
|
66
|
+
faraday.adapter Faraday.default_adapter
|
67
|
+
faraday.headers['User-Agent'] = "GitlabRuby gem v#{VERSION}"
|
68
|
+
faraday.headers['PRIVATE-TOKEN'] = @token
|
69
|
+
end
|
70
|
+
|
71
|
+
case verb
|
72
|
+
when :put then conn.put(method_name, options)
|
73
|
+
when :post then conn.post(method_name, options)
|
74
|
+
when :delete then conn.delete(method_name, options)
|
75
|
+
else conn.get(method_name, options)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module GitlabRuby
|
2
|
+
module Helpers
|
3
|
+
module QueryChain
|
4
|
+
MUSTERMANN_TEMPLATE_KEY_REGEX = %r(\.|\/)
|
5
|
+
|
6
|
+
def self.to_query_stacks(url_row)
|
7
|
+
query_stacks = Mustermann.new(url_row)
|
8
|
+
.to_templates
|
9
|
+
.first
|
10
|
+
.split(MUSTERMANN_TEMPLATE_KEY_REGEX)
|
11
|
+
query_stacks.map { |query| query if query.size > 1 }.compact
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module GitlabRuby
|
2
|
+
class QueryChain
|
3
|
+
attr_accessor :urlstring
|
4
|
+
attr_accessor :verb
|
5
|
+
|
6
|
+
def initialize(params = {})
|
7
|
+
@verb = params[:verb]
|
8
|
+
@client = params[:client]
|
9
|
+
@urlstring = ''
|
10
|
+
end
|
11
|
+
|
12
|
+
def execute(params = {})
|
13
|
+
@client.api_call(@urlstring, params, @verb)
|
14
|
+
end
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def generate_methods
|
18
|
+
CSV.foreach('lib/gitlab_ruby/routes_table_no_verb.csv') do |url_row|
|
19
|
+
query_stacks = GitlabRuby::Helpers::QueryChain
|
20
|
+
.to_query_stacks(url_row.first)
|
21
|
+
query_stacks.each_with_index do |key|
|
22
|
+
key = key.match(/{(.+)}/)[1] if key.match(/{.+}/)
|
23
|
+
build_method(key)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def build_method(key)
|
31
|
+
define_method key do |*param|
|
32
|
+
if param.size == 1
|
33
|
+
@urlstring = @urlstring + param[0].to_s + '/'
|
34
|
+
elsif param.size.zero?
|
35
|
+
@urlstring = @urlstring + key + '/'
|
36
|
+
else
|
37
|
+
raise GitlabRuby::QueryChainArgumentError
|
38
|
+
end
|
39
|
+
self
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,351 @@
|
|
1
|
+
/:version/groups/:id/access_requests(.:format)
|
2
|
+
/:version/groups/:id/access_requests(.:format)
|
3
|
+
/:version/groups/:id/access_requests/:user_id/approve(.:format)
|
4
|
+
/:version/groups/:id/access_requests/:user_id(.:format)
|
5
|
+
/:version/projects/:id/access_requests(.:format)
|
6
|
+
/:version/projects/:id/access_requests(.:format)
|
7
|
+
/:version/projects/:id/access_requests/:user_id/approve(.:format)
|
8
|
+
/:version/projects/:id/access_requests/:user_id(.:format)
|
9
|
+
/:version/projects/:id/issues/:issue_iid/award_emoji(.:format)
|
10
|
+
/:version/projects/:id/issues/:issue_iid/award_emoji/:award_id(.:format)
|
11
|
+
/:version/projects/:id/issues/:issue_iid/award_emoji(.:format)
|
12
|
+
/:version/projects/:id/issues/:issue_iid/award_emoji/:award_id(.:format)
|
13
|
+
/:version/projects/:id/issues/:issue_iid/notes/:note_id/award_emoji(.:format)
|
14
|
+
/:version/projects/:id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id(.:format)
|
15
|
+
/:version/projects/:id/issues/:issue_iid/notes/:note_id/award_emoji(.:format)
|
16
|
+
/:version/projects/:id/issues/:issue_iid/notes/:note_id/award_emoji/:award_id(.:format)
|
17
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/award_emoji(.:format)
|
18
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/award_emoji/:award_id(.:format)
|
19
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/award_emoji(.:format)
|
20
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/award_emoji/:award_id(.:format)
|
21
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji(.:format)
|
22
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji/:award_id(.:format)
|
23
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji(.:format)
|
24
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/notes/:note_id/award_emoji/:award_id(.:format)
|
25
|
+
/:version/projects/:id/snippets/:snippet_id/award_emoji(.:format)
|
26
|
+
/:version/projects/:id/snippets/:snippet_id/award_emoji/:award_id(.:format)
|
27
|
+
/:version/projects/:id/snippets/:snippet_id/award_emoji(.:format)
|
28
|
+
/:version/projects/:id/snippets/:snippet_id/award_emoji/:award_id(.:format)
|
29
|
+
/:version/projects/:id/snippets/:snippet_id/notes/:note_id/award_emoji(.:format)
|
30
|
+
/:version/projects/:id/snippets/:snippet_id/notes/:note_id/award_emoji/:award_id(.:format)
|
31
|
+
/:version/projects/:id/snippets/:snippet_id/notes/:note_id/award_emoji(.:format)
|
32
|
+
/:version/projects/:id/snippets/:snippet_id/notes/:note_id/award_emoji/:award_id(.:format)
|
33
|
+
/:version/projects/:id/boards(.:format)
|
34
|
+
/:version/projects/:id/boards/:board_id/lists(.:format)
|
35
|
+
/:version/projects/:id/boards/:board_id/lists/:list_id(.:format)
|
36
|
+
/:version/projects/:id/boards/:board_id/lists(.:format)
|
37
|
+
/:version/projects/:id/boards/:board_id/lists/:list_id(.:format)
|
38
|
+
/:version/projects/:id/boards/:board_id/lists/:list_id(.:format)
|
39
|
+
/:version/projects/:id/repository/branches(.:format)
|
40
|
+
/:version/projects/:id/repository/branches/:branch(.:format)
|
41
|
+
/:version/projects/:id/repository/branches/:branch/protect(.:format)
|
42
|
+
/:version/projects/:id/repository/branches/:branch/unprotect(.:format)
|
43
|
+
/:version/projects/:id/repository/branches(.:format)
|
44
|
+
/:version/projects/:id/repository/branches/:branch(.:format)
|
45
|
+
/:version/projects/:id/repository/merged_branches(.:format)
|
46
|
+
/:version/broadcast_messages(.:format)
|
47
|
+
/:version/broadcast_messages(.:format)
|
48
|
+
/:version/broadcast_messages/:id(.:format)
|
49
|
+
/:version/broadcast_messages/:id(.:format)
|
50
|
+
/:version/broadcast_messages/:id(.:format)
|
51
|
+
/:version/projects/:id/repository/commits(.:format)
|
52
|
+
/:version/projects/:id/repository/commits(.:format)
|
53
|
+
/:version/projects/:id/repository/commits/:sha(.:format)
|
54
|
+
/:version/projects/:id/repository/commits/:sha/diff(.:format)
|
55
|
+
/:version/projects/:id/repository/commits/:sha/comments(.:format)
|
56
|
+
/:version/projects/:id/repository/commits/:sha/cherry_pick(.:format)
|
57
|
+
/:version/projects/:id/repository/commits/:sha/comments(.:format)
|
58
|
+
/:version/projects/:id/repository/commits/:sha/statuses(.:format)
|
59
|
+
/:version/projects/:id/statuses/:sha(.:format)
|
60
|
+
/:version/deploy_keys(.:format)
|
61
|
+
/:version/projects/:id/deploy_keys(.:format)
|
62
|
+
/:version/projects/:id/deploy_keys/:key_id(.:format)
|
63
|
+
/:version/projects/:id/deploy_keys(.:format)
|
64
|
+
/:version/projects/:id/deploy_keys/:key_id/enable(.:format)
|
65
|
+
/:version/projects/:id/deploy_keys/:key_id(.:format)
|
66
|
+
/:version/projects/:id/deployments(.:format)
|
67
|
+
/:version/projects/:id/deployments/:deployment_id(.:format)
|
68
|
+
/:version/projects/:id/environments(.:format)
|
69
|
+
/:version/projects/:id/environments(.:format)
|
70
|
+
/:version/projects/:id/environments/:environment_id(.:format)
|
71
|
+
/:version/projects/:id/environments/:environment_id(.:format)
|
72
|
+
/:version/projects/:id/environments/:environment_id/stop(.:format)
|
73
|
+
/:version/projects/:id/repository/files/:file_path/raw(.:format)
|
74
|
+
/:version/projects/:id/repository/files/:file_path(.:format)
|
75
|
+
/:version/projects/:id/repository/files/:file_path(.:format)
|
76
|
+
/:version/projects/:id/repository/files/:file_path(.:format)
|
77
|
+
/:version/projects/:id/repository/files/:file_path(.:format)
|
78
|
+
/:version/groups(.:format)
|
79
|
+
/:version/groups(.:format)
|
80
|
+
/:version/groups/:id(.:format)
|
81
|
+
/:version/groups/:id(.:format)
|
82
|
+
/:version/groups/:id(.:format)
|
83
|
+
/:version/groups/:id/projects(.:format)
|
84
|
+
/:version/groups/:id/projects/:project_id(.:format)
|
85
|
+
/:version/internal/allowed(.:format)
|
86
|
+
/:version/internal/lfs_authenticate(.:format)
|
87
|
+
/:version/internal/merge_request_urls(.:format)
|
88
|
+
/:version/internal/discover(.:format)
|
89
|
+
/:version/internal/check(.:format)
|
90
|
+
/:version/internal/broadcast_message(.:format)
|
91
|
+
/:version/internal/two_factor_recovery_codes(.:format)
|
92
|
+
/:version/internal/notify_post_receive(.:format)
|
93
|
+
/:version/issues(.:format)
|
94
|
+
/:version/groups/:id/issues(.:format)
|
95
|
+
/:version/projects/:id/issues/:issue_iid/time_estimate(.:format)
|
96
|
+
/:version/projects/:id/issues/:issue_iid/reset_time_estimate(.:format)
|
97
|
+
/:version/projects/:id/issues/:issue_iid/add_spent_time(.:format)
|
98
|
+
/:version/projects/:id/issues/:issue_iid/reset_spent_time(.:format)
|
99
|
+
/:version/projects/:id/issues/:issue_iid/time_stats(.:format)
|
100
|
+
/:version/projects/:id/issues(.:format)
|
101
|
+
/:version/projects/:id/issues/:issue_iid(.:format)
|
102
|
+
/:version/projects/:id/issues(.:format)
|
103
|
+
/:version/projects/:id/issues/:issue_iid(.:format)
|
104
|
+
/:version/projects/:id/issues/:issue_iid/move(.:format)
|
105
|
+
/:version/projects/:id/issues/:issue_iid(.:format)
|
106
|
+
/:version/projects/:id/jobs(.:format)
|
107
|
+
/:version/projects/:id/pipelines/:pipeline_id/jobs(.:format)
|
108
|
+
/:version/projects/:id/jobs/:job_id(.:format)
|
109
|
+
/:version/projects/:id/jobs/:job_id/artifacts(.:format)
|
110
|
+
/:version/projects/:id/jobs/artifacts/:ref_name/download(.:format)
|
111
|
+
/:version/projects/:id/jobs/:job_id/trace(.:format)
|
112
|
+
/:version/projects/:id/jobs/:job_id/cancel(.:format)
|
113
|
+
/:version/projects/:id/jobs/:job_id/retry(.:format)
|
114
|
+
/:version/projects/:id/jobs/:job_id/erase(.:format)
|
115
|
+
/:version/projects/:id/jobs/:job_id/artifacts/keep(.:format)
|
116
|
+
/:version/projects/:id/jobs/:job_id/play(.:format)
|
117
|
+
/:version/keys/:id(.:format)
|
118
|
+
/:version/projects/:id/labels(.:format)
|
119
|
+
/:version/projects/:id/labels(.:format)
|
120
|
+
/:version/projects/:id/labels(.:format)
|
121
|
+
/:version/projects/:id/labels(.:format)
|
122
|
+
/:version/ci/lint(.:format)
|
123
|
+
/:version/groups/:id/members(.:format)
|
124
|
+
/:version/groups/:id/members/:user_id(.:format)
|
125
|
+
/:version/groups/:id/members(.:format)
|
126
|
+
/:version/groups/:id/members/:user_id(.:format)
|
127
|
+
/:version/groups/:id/members/:user_id(.:format)
|
128
|
+
/:version/projects/:id/members(.:format)
|
129
|
+
/:version/projects/:id/members/:user_id(.:format)
|
130
|
+
/:version/projects/:id/members(.:format)
|
131
|
+
/:version/projects/:id/members/:user_id(.:format)
|
132
|
+
/:version/projects/:id/members/:user_id(.:format)
|
133
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/versions(.:format)
|
134
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/versions/:version_id(.:format)
|
135
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/time_estimate(.:format)
|
136
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/reset_time_estimate(.:format)
|
137
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/add_spent_time(.:format)
|
138
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/reset_spent_time(.:format)
|
139
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/time_stats(.:format)
|
140
|
+
/:version/projects/:id/merge_requests(.:format)
|
141
|
+
/:version/projects/:id/merge_requests(.:format)
|
142
|
+
/:version/projects/:id/merge_requests/:merge_request_iid(.:format)
|
143
|
+
/:version/projects/:id/merge_requests/:merge_request_iid(.:format)
|
144
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/commits(.:format)
|
145
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/changes(.:format)
|
146
|
+
/:version/projects/:id/merge_requests/:merge_request_iid(.:format)
|
147
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/merge(.:format)
|
148
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/cancel_merge_when_pipeline_succeeds(.:format)
|
149
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/comments(.:format)
|
150
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/comments(.:format)
|
151
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/closes_issues(.:format)
|
152
|
+
/:version/projects/:id/milestones(.:format)
|
153
|
+
/:version/projects/:id/milestones/:milestone_id(.:format)
|
154
|
+
/:version/projects/:id/milestones(.:format)
|
155
|
+
/:version/projects/:id/milestones/:milestone_id(.:format)
|
156
|
+
/:version/projects/:id/milestones/:milestone_id/issues(.:format)
|
157
|
+
/:version/projects/:id/milestones/:milestone_id/merge_requests(.:format)
|
158
|
+
/:version/namespaces(.:format)
|
159
|
+
/:version/projects/:id/issues/:noteable_id/notes(.:format)
|
160
|
+
/:version/projects/:id/issues/:noteable_id/notes/:note_id(.:format)
|
161
|
+
/:version/projects/:id/issues/:noteable_id/notes(.:format)
|
162
|
+
/:version/projects/:id/issues/:noteable_id/notes/:note_id(.:format)
|
163
|
+
/:version/projects/:id/issues/:noteable_id/notes/:note_id(.:format)
|
164
|
+
/:version/projects/:id/merge_requests/:noteable_id/notes(.:format)
|
165
|
+
/:version/projects/:id/merge_requests/:noteable_id/notes/:note_id(.:format)
|
166
|
+
/:version/projects/:id/merge_requests/:noteable_id/notes(.:format)
|
167
|
+
/:version/projects/:id/merge_requests/:noteable_id/notes/:note_id(.:format)
|
168
|
+
/:version/projects/:id/merge_requests/:noteable_id/notes/:note_id(.:format)
|
169
|
+
/:version/projects/:id/snippets/:noteable_id/notes(.:format)
|
170
|
+
/:version/projects/:id/snippets/:noteable_id/notes/:note_id(.:format)
|
171
|
+
/:version/projects/:id/snippets/:noteable_id/notes(.:format)
|
172
|
+
/:version/projects/:id/snippets/:noteable_id/notes/:note_id(.:format)
|
173
|
+
/:version/projects/:id/snippets/:noteable_id/notes/:note_id(.:format)
|
174
|
+
/:version/notification_settings(.:format)
|
175
|
+
/:version/notification_settings(.:format)
|
176
|
+
/:version/groups/:id/notification_settings(.:format)
|
177
|
+
/:version/groups/:id/notification_settings(.:format)
|
178
|
+
/:version/projects/:id/notification_settings(.:format)
|
179
|
+
/:version/projects/:id/notification_settings(.:format)
|
180
|
+
/:version/projects/:id/pipelines(.:format)
|
181
|
+
/:version/projects/:id/pipeline(.:format)
|
182
|
+
/:version/projects/:id/pipelines/:pipeline_id(.:format)
|
183
|
+
/:version/projects/:id/pipelines/:pipeline_id/retry(.:format)
|
184
|
+
/:version/projects/:id/pipelines/:pipeline_id/cancel(.:format)
|
185
|
+
/:version/projects/:id/hooks(.:format)
|
186
|
+
/:version/projects/:id/hooks/:hook_id(.:format)
|
187
|
+
/:version/projects/:id/hooks(.:format)
|
188
|
+
/:version/projects/:id/hooks/:hook_id(.:format)
|
189
|
+
/:version/projects/:id/hooks/:hook_id(.:format)
|
190
|
+
/:version/projects(.:format)
|
191
|
+
/:version/projects(.:format)
|
192
|
+
/:version/projects/user/:user_id(.:format)
|
193
|
+
/:version/projects/:id(.:format)
|
194
|
+
/:version/projects/:id/events(.:format)
|
195
|
+
/:version/projects/:id/fork(.:format)
|
196
|
+
/:version/projects/:id(.:format)
|
197
|
+
/:version/projects/:id/archive(.:format)
|
198
|
+
/:version/projects/:id/unarchive(.:format)
|
199
|
+
/:version/projects/:id/star(.:format)
|
200
|
+
/:version/projects/:id/unstar(.:format)
|
201
|
+
/:version/projects/:id(.:format)
|
202
|
+
/:version/projects/:id/fork/:forked_from_id(.:format)
|
203
|
+
/:version/projects/:id/fork(.:format)
|
204
|
+
/:version/projects/:id/share(.:format)
|
205
|
+
/:version/projects/:id/share/:group_id(.:format)
|
206
|
+
/:version/projects/:id/uploads(.:format)
|
207
|
+
/:version/projects/:id/users(.:format)
|
208
|
+
/:version/projects/:id/housekeeping(.:format)
|
209
|
+
/:version/projects/:id/snippets(.:format)
|
210
|
+
/:version/projects/:id/snippets/:snippet_id(.:format)
|
211
|
+
/:version/projects/:id/snippets(.:format)
|
212
|
+
/:version/projects/:id/snippets/:snippet_id(.:format)
|
213
|
+
/:version/projects/:id/snippets/:snippet_id(.:format)
|
214
|
+
/:version/projects/:id/snippets/:snippet_id/raw(.:format)
|
215
|
+
/:version/projects/:id/repository/tree(.:format)
|
216
|
+
/:version/projects/:id/repository/blobs/:sha/raw(.:format)
|
217
|
+
/:version/projects/:id/repository/blobs/:sha(.:format)
|
218
|
+
/:version/projects/:id/repository/archive(.:format)
|
219
|
+
/:version/projects/:id/repository/compare(.:format)
|
220
|
+
/:version/projects/:id/repository/contributors(.:format)
|
221
|
+
/:version/runners(.:format)
|
222
|
+
/:version/runners(.:format)
|
223
|
+
/:version/jobs/request(.:format)
|
224
|
+
/:version/jobs/:id(.:format)
|
225
|
+
/:version/jobs/:id/trace(.:format)
|
226
|
+
/:version/jobs/:id/artifacts/authorize(.:format)
|
227
|
+
/:version/jobs/:id/artifacts(.:format)
|
228
|
+
/:version/jobs/:id/artifacts(.:format)
|
229
|
+
/:version/runners(.:format)
|
230
|
+
/:version/runners/all(.:format)
|
231
|
+
/:version/runners/:id(.:format)
|
232
|
+
/:version/runners/:id(.:format)
|
233
|
+
/:version/runners/:id(.:format)
|
234
|
+
/:version/projects/:id/runners(.:format)
|
235
|
+
/:version/projects/:id/runners(.:format)
|
236
|
+
/:version/projects/:id/runners/:runner_id(.:format)
|
237
|
+
/:version/projects/:id/services/asana(.:format)
|
238
|
+
/:version/projects/:id/services/assembla(.:format)
|
239
|
+
/:version/projects/:id/services/bamboo(.:format)
|
240
|
+
/:version/projects/:id/services/bugzilla(.:format)
|
241
|
+
/:version/projects/:id/services/buildkite(.:format)
|
242
|
+
/:version/projects/:id/services/builds-email(.:format)
|
243
|
+
/:version/projects/:id/services/campfire(.:format)
|
244
|
+
/:version/projects/:id/services/custom-issue-tracker(.:format)
|
245
|
+
/:version/projects/:id/services/drone-ci(.:format)
|
246
|
+
/:version/projects/:id/services/emails-on-push(.:format)
|
247
|
+
/:version/projects/:id/services/external-wiki(.:format)
|
248
|
+
/:version/projects/:id/services/flowdock(.:format)
|
249
|
+
/:version/projects/:id/services/gemnasium(.:format)
|
250
|
+
/:version/projects/:id/services/hipchat(.:format)
|
251
|
+
/:version/projects/:id/services/irker(.:format)
|
252
|
+
/:version/projects/:id/services/jira(.:format)
|
253
|
+
/:version/projects/:id/services/kubernetes(.:format)
|
254
|
+
/:version/projects/:id/services/mattermost-slash-commands(.:format)
|
255
|
+
/:version/projects/:id/services/slack-slash-commands(.:format)
|
256
|
+
/:version/projects/:id/services/pipelines-email(.:format)
|
257
|
+
/:version/projects/:id/services/pivotaltracker(.:format)
|
258
|
+
/:version/projects/:id/services/prometheus(.:format)
|
259
|
+
/:version/projects/:id/services/pushover(.:format)
|
260
|
+
/:version/projects/:id/services/redmine(.:format)
|
261
|
+
/:version/projects/:id/services/slack(.:format)
|
262
|
+
/:version/projects/:id/services/mattermost(.:format)
|
263
|
+
/:version/projects/:id/services/teamcity(.:format)
|
264
|
+
/:version/projects/:id/services/mock-ci(.:format)
|
265
|
+
/:version/projects/:id/services/:service_slug(.:format)
|
266
|
+
/:version/projects/:id/services/:service_slug(.:format)
|
267
|
+
/:version/projects/:id/services/mattermost_slash_commands/trigger(.:format)
|
268
|
+
/:version/projects/:id/services/slack_slash_commands/trigger(.:format)
|
269
|
+
/:version/session(.:format)
|
270
|
+
/:version/application/settings(.:format)
|
271
|
+
/:version/application/settings(.:format)
|
272
|
+
/:version/sidekiq/queue_metrics(.:format)
|
273
|
+
/:version/sidekiq/process_metrics(.:format)
|
274
|
+
/:version/sidekiq/job_stats(.:format)
|
275
|
+
/:version/sidekiq/compound_metrics(.:format)
|
276
|
+
/:version/snippets(.:format)
|
277
|
+
/:version/snippets/public(.:format)
|
278
|
+
/:version/snippets/:id(.:format)
|
279
|
+
/:version/snippets(.:format)
|
280
|
+
/:version/snippets/:id(.:format)
|
281
|
+
/:version/snippets/:id(.:format)
|
282
|
+
/:version/snippets/:id/raw(.:format)
|
283
|
+
/:version/projects/:id/merge_requests/:subscribable_id/subscribe(.:format)
|
284
|
+
/:version/projects/:id/merge_requests/:subscribable_id/unsubscribe(.:format)
|
285
|
+
/:version/projects/:id/issues/:subscribable_id/subscribe(.:format)
|
286
|
+
/:version/projects/:id/issues/:subscribable_id/unsubscribe(.:format)
|
287
|
+
/:version/projects/:id/labels/:subscribable_id/subscribe(.:format)
|
288
|
+
/:version/projects/:id/labels/:subscribable_id/unsubscribe(.:format)
|
289
|
+
/:version/hooks(.:format)
|
290
|
+
/:version/hooks(.:format)
|
291
|
+
/:version/hooks/:id(.:format)
|
292
|
+
/:version/hooks/:id(.:format)
|
293
|
+
/:version/projects/:id/repository/tags(.:format)
|
294
|
+
/:version/projects/:id/repository/tags/:tag_name(.:format)
|
295
|
+
/:version/projects/:id/repository/tags(.:format)
|
296
|
+
/:version/projects/:id/repository/tags/:tag_name(.:format)
|
297
|
+
/:version/projects/:id/repository/tags/:tag_name/release(.:format)
|
298
|
+
/:version/projects/:id/repository/tags/:tag_name/release(.:format)
|
299
|
+
/:version/templates/licenses(.:format)
|
300
|
+
/:version/templates/licenses/:name(.:format)
|
301
|
+
/:version/templates/gitignores(.:format)
|
302
|
+
/:version/templates/gitignores/:name(.:format)
|
303
|
+
/:version/templates/gitlab_ci_ymls(.:format)
|
304
|
+
/:version/templates/gitlab_ci_ymls/:name(.:format)
|
305
|
+
/:version/templates/dockerfiles(.:format)
|
306
|
+
/:version/templates/dockerfiles/:name(.:format)
|
307
|
+
/:version/projects/:id/merge_requests/:merge_request_iid/todo(.:format)
|
308
|
+
/:version/projects/:id/issues/:issue_iid/todo(.:format)
|
309
|
+
/:version/todos(.:format)
|
310
|
+
/:version/todos/:id/mark_as_done(.:format)
|
311
|
+
/:version/todos/mark_as_done(.:format)
|
312
|
+
/:version/projects/:id/(ref/:ref/)trigger/pipeline(.:format)
|
313
|
+
/:version/projects/:id/triggers(.:format)
|
314
|
+
/:version/projects/:id/triggers/:trigger_id(.:format)
|
315
|
+
/:version/projects/:id/triggers(.:format)
|
316
|
+
/:version/projects/:id/triggers/:trigger_id(.:format)
|
317
|
+
/:version/projects/:id/triggers/:trigger_id/take_ownership(.:format)
|
318
|
+
/:version/projects/:id/triggers/:trigger_id(.:format)
|
319
|
+
/:version/users(.:format)
|
320
|
+
/:version/users/:id(.:format)
|
321
|
+
/:version/users(.:format)
|
322
|
+
/:version/users/:id(.:format)
|
323
|
+
/:version/users/:id/keys(.:format)
|
324
|
+
/:version/users/:id/keys(.:format)
|
325
|
+
/:version/users/:id/keys/:key_id(.:format)
|
326
|
+
/:version/users/:id/emails(.:format)
|
327
|
+
/:version/users/:id/emails(.:format)
|
328
|
+
/:version/users/:id/emails/:email_id(.:format)
|
329
|
+
/:version/users/:id(.:format)
|
330
|
+
/:version/users/:id/block(.:format)
|
331
|
+
/:version/users/:id/unblock(.:format)
|
332
|
+
/:version/users/:id/events(.:format)
|
333
|
+
/:version/users/:user_id/impersonation_tokens(.:format)
|
334
|
+
/:version/users/:user_id/impersonation_tokens(.:format)
|
335
|
+
/:version/users/:user_id/impersonation_tokens/:impersonation_token_id(.:format)
|
336
|
+
/:version/users/:user_id/impersonation_tokens/:impersonation_token_id(.:format)
|
337
|
+
/:version/user(.:format)
|
338
|
+
/:version/user/keys(.:format)
|
339
|
+
/:version/user/keys/:key_id(.:format)
|
340
|
+
/:version/user/keys(.:format)
|
341
|
+
/:version/user/keys/:key_id(.:format)
|
342
|
+
/:version/user/emails(.:format)
|
343
|
+
/:version/user/emails/:email_id(.:format)
|
344
|
+
/:version/user/emails(.:format)
|
345
|
+
/:version/user/emails/:email_id(.:format)
|
346
|
+
/:version/projects/:id/variables(.:format)
|
347
|
+
/:version/projects/:id/variables/:key(.:format)
|
348
|
+
/:version/projects/:id/variables(.:format)
|
349
|
+
/:version/projects/:id/variables/:key(.:format)
|
350
|
+
/:version/projects/:id/variables/:key(.:format)
|
351
|
+
/:version/version(.:format)
|
metadata
ADDED
@@ -0,0 +1,176 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gitlab_ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- TM Lee
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-03-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.11'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mustermann
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.14'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.14'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: vcr
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: webmock
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.3'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.3'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: byebug
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: Interact with Gitlab API on Ruby with method chaining
|
126
|
+
email:
|
127
|
+
- tm89lee@gmail.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- ".gitignore"
|
133
|
+
- ".rspec"
|
134
|
+
- ".travis.yml"
|
135
|
+
- CODE_OF_CONDUCT.md
|
136
|
+
- Gemfile
|
137
|
+
- LICENSE.txt
|
138
|
+
- README.md
|
139
|
+
- Rakefile
|
140
|
+
- bin/console
|
141
|
+
- bin/setup
|
142
|
+
- gitlab_ruby.gemspec
|
143
|
+
- lib/gitlab_ruby.rb
|
144
|
+
- lib/gitlab_ruby/api_errors.rb
|
145
|
+
- lib/gitlab_ruby/api_object.rb
|
146
|
+
- lib/gitlab_ruby/client.rb
|
147
|
+
- lib/gitlab_ruby/errors.rb
|
148
|
+
- lib/gitlab_ruby/helpers/query_chain.rb
|
149
|
+
- lib/gitlab_ruby/query_chain.rb
|
150
|
+
- lib/gitlab_ruby/routes_table_no_verb.csv
|
151
|
+
- lib/gitlab_ruby/version.rb
|
152
|
+
homepage: https://github.com/tmlee/gitlab_ruby
|
153
|
+
licenses:
|
154
|
+
- MIT
|
155
|
+
metadata: {}
|
156
|
+
post_install_message:
|
157
|
+
rdoc_options: []
|
158
|
+
require_paths:
|
159
|
+
- lib
|
160
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
161
|
+
requirements:
|
162
|
+
- - ">="
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
165
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - ">="
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
requirements: []
|
171
|
+
rubyforge_project:
|
172
|
+
rubygems_version: 2.5.0
|
173
|
+
signing_key:
|
174
|
+
specification_version: 4
|
175
|
+
summary: Ruby wrapper for the Gitlab API (Supports V3 & V4)
|
176
|
+
test_files: []
|