ossy 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/ossy/github/client.rb +15 -14
- data/lib/ossy/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dfdf802909b30bd081ea1e537437d38b52ef117a769e0696bb6b024ab57c9e4
|
4
|
+
data.tar.gz: a0aaf3afa2381cd6db31a72668ee57020e2ada102120e1c9f171c2757198c8bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51a44d6e250c9e1482625dfec2ce42c16d73571f06c5bcb6508b682bb530fd33a6ef9657ba9757a05b7b6c9f073059d272e23bbb38e4f26ba3479e0c8f989fcb
|
7
|
+
data.tar.gz: e687709b8d88ad167035c6259ae01604d0ece52ed54994cbd81fba0007186a389b6dd8ac023f8ae394c7e5951dc0ba24e9b021690cc2b70f4b5e749cd1093bbb
|
data/CHANGELOG.md
CHANGED
data/lib/ossy/github/client.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'ossy/import'
|
4
4
|
|
5
|
-
require '
|
5
|
+
require 'faraday'
|
6
6
|
require 'json'
|
7
7
|
|
8
8
|
module Ossy
|
@@ -16,7 +16,7 @@ module Ossy
|
|
16
16
|
path = "orgs/#{org}/teams/#{team}/memberships/#{username}"
|
17
17
|
resp = get(path)
|
18
18
|
|
19
|
-
return false unless resp.
|
19
|
+
return false unless resp.status.equal?(200)
|
20
20
|
|
21
21
|
json = JSON.parse(resp.body)
|
22
22
|
|
@@ -27,14 +27,14 @@ module Ossy
|
|
27
27
|
path = "repos/#{repo}/git/ref/tags/#{tag}"
|
28
28
|
resp = get(path)
|
29
29
|
|
30
|
-
return false unless resp.
|
30
|
+
return false unless resp.status.equal?(200)
|
31
31
|
|
32
32
|
sha = JSON.parse(resp.body)['object']['sha']
|
33
33
|
|
34
34
|
path = "repos/#{repo}/git/tags/#{sha}"
|
35
35
|
resp = get(path)
|
36
36
|
|
37
|
-
return false unless resp.
|
37
|
+
return false unless resp.status.equal?(200)
|
38
38
|
|
39
39
|
json = JSON.parse(resp.body)
|
40
40
|
|
@@ -45,7 +45,7 @@ module Ossy
|
|
45
45
|
path = "orgs/#{org}/members"
|
46
46
|
resp = get(path)
|
47
47
|
|
48
|
-
return nil unless resp.
|
48
|
+
return nil unless resp.status.equal?(200)
|
49
49
|
|
50
50
|
user = JSON.parse(resp.body)
|
51
51
|
.map { |member| user(member['login']) }
|
@@ -58,13 +58,13 @@ module Ossy
|
|
58
58
|
path = "users/#{login}"
|
59
59
|
resp = get(path)
|
60
60
|
|
61
|
-
return nil unless resp.
|
61
|
+
return nil unless resp.status.equal?(200)
|
62
62
|
|
63
63
|
JSON.parse(resp.body)
|
64
64
|
end
|
65
65
|
|
66
66
|
def request(meth, path, opts = {})
|
67
|
-
http.public_send(meth,
|
67
|
+
http.public_send(meth, path, opts)
|
68
68
|
end
|
69
69
|
|
70
70
|
def get(path, opts = {})
|
@@ -72,17 +72,18 @@ module Ossy
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def post(path, input)
|
75
|
-
request(:post, path,
|
75
|
+
request(:post, path, JSON.dump(input))
|
76
76
|
end
|
77
77
|
|
78
|
-
def
|
79
|
-
|
78
|
+
def http
|
79
|
+
@http ||= Faraday.new(url: BASE_URL, headers: headers) do |conn|
|
80
|
+
conn.basic_auth(settings.github_login, settings.github_token)
|
81
|
+
end
|
80
82
|
end
|
81
83
|
|
82
|
-
def
|
83
|
-
|
84
|
-
|
85
|
-
.basic_auth(user: settings.github_login, pass: settings.github_token)
|
84
|
+
def headers
|
85
|
+
{ 'Content-Type' => 'application/json',
|
86
|
+
'Accept' => 'application/vnd.github.everest-preview+json' }
|
86
87
|
end
|
87
88
|
end
|
88
89
|
end
|
data/lib/ossy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ossy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
@@ -93,19 +93,19 @@ dependencies:
|
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '0.14'
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
96
|
+
name: faraday
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
99
|
- - "~>"
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: '
|
101
|
+
version: '1.0'
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - "~>"
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
108
|
+
version: '1.0'
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: tilt
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|