taskmapper-github 0.10.3 → 0.10.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/provider/github.rb +18 -14
- data/taskmapper-github.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.4
|
data/lib/provider/github.rb
CHANGED
@@ -12,23 +12,27 @@ module TaskMapper::Provider
|
|
12
12
|
TaskMapper.new(:github, auth)
|
13
13
|
end
|
14
14
|
|
15
|
-
def provider
|
16
|
-
TaskMapper::Provider::Github
|
17
|
-
end
|
18
|
-
|
19
|
-
def new_github_client(auth)
|
20
|
-
Octokit::Client.new auth
|
21
|
-
end
|
22
|
-
|
23
15
|
# declare needed overloaded methods here
|
24
16
|
def authorize(auth = {})
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
17
|
+
@authentication ||= TaskMapper::Authenticator.new(auth)
|
18
|
+
auth = @authentication
|
19
|
+
login = auth.login || auth.username
|
20
|
+
if auth.login.blank? and auth.username.blank?
|
21
|
+
raise TaskMapper::Exception.new('Please provide at least a username')
|
22
|
+
elsif auth.token
|
23
|
+
TaskMapper::Provider::Github.login = login
|
24
|
+
TaskMapper::Provider::Github.user_token = auth.token
|
25
|
+
TaskMapper::Provider::Github.api = Octokit::Client.new(:login => login, :token => auth.token)
|
26
|
+
elsif auth.password
|
27
|
+
TaskMapper::Provider::Github.login = login
|
28
|
+
TaskMapper::Provider::Github.user_token = auth.token
|
29
|
+
TaskMapper::Provider::Github.api = Octokit::Client.new(:login => login, :password => auth.password)
|
30
|
+
else
|
31
|
+
TaskMapper::Provider::Github.login = login
|
32
|
+
TaskMapper::Provider::Github.user_token = nil
|
33
|
+
TaskMapper::Provider::Github.api = Octokit::Client.new(:login => login)
|
34
|
+
end
|
30
35
|
end
|
31
|
-
|
32
36
|
|
33
37
|
def valid?
|
34
38
|
TaskMapper::Provider::Github.api.authenticated? || TaskMapper::Provider::Github.api.oauthed?
|
data/taskmapper-github.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taskmapper-github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -181,7 +181,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
181
|
version: '0'
|
182
182
|
segments:
|
183
183
|
- 0
|
184
|
-
hash:
|
184
|
+
hash: -366567343
|
185
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
186
|
none: false
|
187
187
|
requirements:
|