github_client 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -4
- data/lib/github_client/client.rb +2 -1
- data/lib/github_client/requests/get_org_repositories_request.rb +0 -1
- data/lib/github_client/requests/get_repositories_for_user_request.rb +25 -0
- data/lib/github_client/requests/{get_user_repositories_request.rb → get_repositories_request.rb} +1 -2
- data/lib/github_client/responses/get_org_repositories_response.rb +0 -1
- data/lib/github_client/responses/get_repositories_for_user_response.rb +14 -0
- data/lib/github_client/responses/{get_user_repositories_response.rb → get_repositories_response.rb} +1 -2
- data/lib/github_client/version.rb +1 -1
- data/lib/github_client.rb +4 -2
- metadata +6 -7
- data/fixtures/vcr_cassettes/_get_org_repositories/_body/returns_all_org_repositories.yml +0 -115
- data/fixtures/vcr_cassettes/_get_user_repositories/_body/with_visibility_argument/gets_repositories_based_on_visibility.yml +0 -207
- data/fixtures/vcr_cassettes/_get_user_repositories/_body/without_any_arguments/gets_all_repositories.yml +0 -218
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8b59b107f99872a6f136b4b43808250fd315f6aa0bcbdcd5b63572c32b47f94
|
4
|
+
data.tar.gz: 223ae2d78a2855a6918bb28964b5e8443746f24d212d7cdec90cafc72f9b9439
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7feb24bacc61b5b9b1560a3694360e57d31cd5fa5660e3b93a64c92c278e44ffab626f361dfa0c9e939b3db59d60c20c5b96dbd95f15681fc73b3fc53766d984
|
7
|
+
data.tar.gz: 355fa556d9c5d11d365d2048dc8b2bce98f4777e6987287f4f869a8f3dbd06d2f42998a3eeb8f57319656e20154e0a0b390f093ffeecf9b58d4bb9760f22208d
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## [2.0.0] - 2019-02-09
|
8
|
+
### Added
|
9
|
+
- `#get_repositories_for_user` method that returns the public repositories --
|
10
|
+
given a GitHub username.
|
11
|
+
- [breaking] Rename method from `#get_user_repositories` to `#get_repositories`.
|
12
|
+
|
7
13
|
## [1.2.0] - 2019-02-03
|
8
14
|
### Added
|
9
15
|
- Require `uri` and `json` libraries.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -18,8 +18,6 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
$ gem install github_client
|
20
20
|
|
21
|
-
## Usage
|
22
|
-
|
23
21
|
### Initialize the Client
|
24
22
|
|
25
23
|
```ruby
|
@@ -38,7 +36,7 @@ GithubClient.configure do |config|
|
|
38
36
|
end
|
39
37
|
```
|
40
38
|
|
41
|
-
|
39
|
+
## Usage
|
42
40
|
|
43
41
|
See `spec/acceptance` for usage.
|
44
42
|
|
@@ -50,7 +48,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
50
48
|
|
51
49
|
## Contributing
|
52
50
|
|
53
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
51
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/MarkFChavez/github_client-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.
|
54
52
|
|
55
53
|
## License
|
56
54
|
|
data/lib/github_client/client.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
module GithubClient
|
2
|
+
class GetRepositoriesForUserRequest
|
3
|
+
|
4
|
+
include APIClientBase::Request.module
|
5
|
+
attribute :access_token, String
|
6
|
+
attribute :username, String
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def path
|
11
|
+
"/users/#{username}/repos"
|
12
|
+
end
|
13
|
+
|
14
|
+
def headers
|
15
|
+
{
|
16
|
+
"Authorization" => "token #{access_token}"
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
def default_action
|
21
|
+
:get
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module GithubClient
|
2
|
+
class GetRepositoriesForUserResponse
|
3
|
+
|
4
|
+
include APIClientBase::Response.module
|
5
|
+
attribute :body, Array, lazy: true, default: :default_body
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def default_body
|
10
|
+
JSON.parse(raw_response.body).map(&:with_indifferent_access)
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
data/lib/github_client.rb
CHANGED
@@ -13,7 +13,9 @@ module GithubClient
|
|
13
13
|
end
|
14
14
|
|
15
15
|
require "github_client/client"
|
16
|
-
require "github_client/requests/
|
16
|
+
require "github_client/requests/get_repositories_request"
|
17
|
+
require "github_client/requests/get_repositories_for_user_request"
|
17
18
|
require "github_client/requests/get_org_repositories_request"
|
18
|
-
require "github_client/responses/
|
19
|
+
require "github_client/responses/get_repositories_response"
|
20
|
+
require "github_client/responses/get_repositories_for_user_response"
|
19
21
|
require "github_client/responses/get_org_repositories_response"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Chavez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: api_client_base
|
@@ -141,16 +141,15 @@ files:
|
|
141
141
|
- Rakefile
|
142
142
|
- bin/console
|
143
143
|
- bin/setup
|
144
|
-
- fixtures/vcr_cassettes/_get_org_repositories/_body/returns_all_org_repositories.yml
|
145
|
-
- fixtures/vcr_cassettes/_get_user_repositories/_body/with_visibility_argument/gets_repositories_based_on_visibility.yml
|
146
|
-
- fixtures/vcr_cassettes/_get_user_repositories/_body/without_any_arguments/gets_all_repositories.yml
|
147
144
|
- github_client.gemspec
|
148
145
|
- lib/github_client.rb
|
149
146
|
- lib/github_client/client.rb
|
150
147
|
- lib/github_client/requests/get_org_repositories_request.rb
|
151
|
-
- lib/github_client/requests/
|
148
|
+
- lib/github_client/requests/get_repositories_for_user_request.rb
|
149
|
+
- lib/github_client/requests/get_repositories_request.rb
|
152
150
|
- lib/github_client/responses/get_org_repositories_response.rb
|
153
|
-
- lib/github_client/responses/
|
151
|
+
- lib/github_client/responses/get_repositories_for_user_response.rb
|
152
|
+
- lib/github_client/responses/get_repositories_response.rb
|
154
153
|
- lib/github_client/version.rb
|
155
154
|
homepage: https://github.com/MarkFChavez/github_client-ruby
|
156
155
|
licenses:
|