taskmapper-github 0.11.2 → 0.11.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/provider/github.rb +14 -12
- data/lib/provider/octokit_wrapper.rb +13 -0
- data/lib/provider/project.rb +7 -7
- data/lib/provider/ticket.rb +1 -5
- data/spec/ticket_spec.rb +1 -1
- data/taskmapper-github-0.11.2.gem +0 -0
- data/taskmapper-github.gemspec +5 -3
- metadata +6 -4
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.11.
|
1
|
+
0.11.3
|
data/lib/provider/github.rb
CHANGED
@@ -11,25 +11,27 @@ module TaskMapper::Provider
|
|
11
11
|
def self.new(auth = {})
|
12
12
|
TaskMapper.new(:github, auth)
|
13
13
|
end
|
14
|
+
|
15
|
+
def provider
|
16
|
+
TaskMapper::Provider::Github
|
17
|
+
end
|
18
|
+
|
19
|
+
def new_github_client(auth)
|
20
|
+
Octokit::Client.new auth
|
21
|
+
end
|
14
22
|
|
15
23
|
# declare needed overloaded methods here
|
16
24
|
def authorize(auth = {})
|
17
25
|
@authentication ||= TaskMapper::Authenticator.new(auth)
|
18
|
-
login =
|
19
|
-
if login.blank?
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
elsif @authentication.password
|
24
|
-
TaskMapper::Provider::Github.api = Octokit::Client.new(:login => login, :password => @authentication.password)
|
25
|
-
else
|
26
|
-
TaskMapper::Provider::Github.api = Octokit::Client.new(:login => login)
|
27
|
-
end
|
28
|
-
TaskMapper::Provider::Github.login = login
|
26
|
+
auth[:login] = auth[:login] || auth[:username]
|
27
|
+
raise TaskMapper::Exception.new('Please provide at least a username') if auth[:login].blank?
|
28
|
+
provider.login = auth[:login]
|
29
|
+
provider.user_token = auth[:password] || auth[:token]
|
30
|
+
provider.api = new_github_client auth
|
29
31
|
end
|
30
32
|
|
31
33
|
def valid?
|
32
|
-
|
34
|
+
provider.api.authenticated? || provider.api.oauthed?
|
33
35
|
end
|
34
36
|
|
35
37
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module TaskMapper::Provider::Github
|
2
|
+
class OctokitWrapper
|
3
|
+
|
4
|
+
def initialize(username, password)
|
5
|
+
@username = username
|
6
|
+
@password = password
|
7
|
+
@octokit = Octokit::Client.new(:login => @username, :password => @password)
|
8
|
+
end
|
9
|
+
|
10
|
+
def valid?
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/provider/project.rb
CHANGED
@@ -12,11 +12,11 @@ module TaskMapper::Provider
|
|
12
12
|
@system_data = {:client => object}
|
13
13
|
unless object.is_a? Hash
|
14
14
|
hash = {:description => object.description,
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
:created_at => object.created_at,
|
16
|
+
:updated_at => object.created_at,
|
17
|
+
:name => object.name,
|
18
|
+
:id => object.name,
|
19
|
+
:owner => object.owner}
|
20
20
|
else
|
21
21
|
hash = object
|
22
22
|
end
|
@@ -61,8 +61,8 @@ module TaskMapper::Provider
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def find_by_id(id)
|
64
|
-
|
65
|
-
self.new TaskMapper::Provider::Github.api.repository(
|
64
|
+
project_id = "#{TaskMapper::Provider::Github.login}/#{id}" unless id.include?("/")
|
65
|
+
self.new TaskMapper::Provider::Github.api.repository(project_id)
|
66
66
|
end
|
67
67
|
|
68
68
|
def find_all
|
data/lib/provider/ticket.rb
CHANGED
@@ -61,13 +61,9 @@ module TaskMapper::Provider
|
|
61
61
|
search_by_attribute(issues, attributes)
|
62
62
|
end
|
63
63
|
|
64
|
-
def self.last_modified
|
65
|
-
TaskMapper::Provider::Github.api.last_modified || Time.now.httpdate
|
66
|
-
end
|
67
|
-
|
68
64
|
def self.find_all(project_id)
|
69
65
|
issues = []
|
70
|
-
issues = Array(TaskMapper::Provider::Github.api.issues(project_id
|
66
|
+
issues = Array(TaskMapper::Provider::Github.api.issues(project_id))
|
71
67
|
issues += TaskMapper::Provider::Github.api.issues(project_id, {:state => "closed"}) unless issues.empty?
|
72
68
|
issues.collect do |issue|
|
73
69
|
issue.merge!(:project_id => project_id)
|
data/spec/ticket_spec.rb
CHANGED
@@ -9,7 +9,7 @@ describe TaskMapper::Provider::Github::Ticket do
|
|
9
9
|
|
10
10
|
describe "Retrieving tickets" do
|
11
11
|
before(:each) do
|
12
|
-
stub_get('https://taskmapper-user:Tm123456@api.github.com/orgs/2hf/repos
|
12
|
+
stub_get('https://taskmapper-user:Tm123456@api.github.com/orgs/2hf/repos', 'org_repos.json')
|
13
13
|
stub_get('https://taskmapper-user:Tm123456@api.github.com/repos/taskmapper-user/tmtest-repo/issues/1', 'issues/1.json')
|
14
14
|
stub_get('https://taskmapper-user:Tm123456@api.github.com/repos/taskmapper-user/tmtest-repo/issues', 'issues.json')
|
15
15
|
stub_get('https://taskmapper-user:Tm123456@api.github.com/repos/taskmapper-user/tmtest-repo/issues?state=closed', 'issues.json')
|
Binary file
|
data/taskmapper-github.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "taskmapper-github"
|
8
|
-
s.version = "0.11.
|
8
|
+
s.version = "0.11.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["HybridGroup"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-04-01"
|
13
13
|
s.description = "This provides an interface with github through the taskmapper gem."
|
14
14
|
s.email = "hong.quach@abigfisch.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
"VERSION",
|
32
32
|
"lib/provider/comment.rb",
|
33
33
|
"lib/provider/github.rb",
|
34
|
+
"lib/provider/octokit_wrapper.rb",
|
34
35
|
"lib/provider/project.rb",
|
35
36
|
"lib/provider/ticket.rb",
|
36
37
|
"lib/taskmapper-github.rb",
|
@@ -52,11 +53,12 @@ Gem::Specification.new do |s|
|
|
52
53
|
"spec/spec_helper.rb",
|
53
54
|
"spec/taskmapper-github_spec.rb",
|
54
55
|
"spec/ticket_spec.rb",
|
56
|
+
"taskmapper-github-0.11.2.gem",
|
55
57
|
"taskmapper-github.gemspec"
|
56
58
|
]
|
57
59
|
s.homepage = "http://github.com/kiafaldorius/taskmapper-github"
|
58
60
|
s.require_paths = ["lib"]
|
59
|
-
s.rubygems_version = "1.8.
|
61
|
+
s.rubygems_version = "1.8.25"
|
60
62
|
s.summary = "The github provider for taskmapper"
|
61
63
|
|
62
64
|
if s.respond_to? :specification_version then
|
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.11.
|
4
|
+
version: 0.11.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: taskmapper
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- VERSION
|
146
146
|
- lib/provider/comment.rb
|
147
147
|
- lib/provider/github.rb
|
148
|
+
- lib/provider/octokit_wrapper.rb
|
148
149
|
- lib/provider/project.rb
|
149
150
|
- lib/provider/ticket.rb
|
150
151
|
- lib/taskmapper-github.rb
|
@@ -166,6 +167,7 @@ files:
|
|
166
167
|
- spec/spec_helper.rb
|
167
168
|
- spec/taskmapper-github_spec.rb
|
168
169
|
- spec/ticket_spec.rb
|
170
|
+
- taskmapper-github-0.11.2.gem
|
169
171
|
- taskmapper-github.gemspec
|
170
172
|
homepage: http://github.com/kiafaldorius/taskmapper-github
|
171
173
|
licenses: []
|
@@ -181,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
183
|
version: '0'
|
182
184
|
segments:
|
183
185
|
- 0
|
184
|
-
hash: -
|
186
|
+
hash: -4503675965697247980
|
185
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
188
|
none: false
|
187
189
|
requirements:
|
@@ -190,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
192
|
version: '0'
|
191
193
|
requirements: []
|
192
194
|
rubyforge_project:
|
193
|
-
rubygems_version: 1.8.
|
195
|
+
rubygems_version: 1.8.25
|
194
196
|
signing_key:
|
195
197
|
specification_version: 3
|
196
198
|
summary: The github provider for taskmapper
|