taskmapper-github 0.10.1 → 0.10.2

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.10.1
1
+ 0.10.2
@@ -58,18 +58,12 @@ module TaskMapper::Provider
58
58
  end
59
59
 
60
60
  def self.create(project_id, ticket_id, comment)
61
+ comment = comment[:body]
61
62
  github_comment = TaskMapper::Provider::Github.api.add_comment(project_id, ticket_id, comment)
62
63
  github_comment.merge!(:project_id => project_id, :ticket_id => ticket_id)
63
- flat_body github_comment
64
64
  self.new github_comment
65
65
  end
66
66
 
67
- #See https://www.kanbanpad.com/projects/31edb8d134e7967c1f0d#!xt-4f994d17014289000707433f
68
- def self.flat_body(comment_hashie)
69
- comment_hashie.body = comment_hashie.body.body
70
- comment_hashie
71
- end
72
-
73
67
  # See https://www.kanbanpad.com/projects/31edb8d134e7967c1f0d#!xt-4f994f2101428900070759fd
74
68
  def self.clean_body!(comment)
75
69
  comment.body = comment.body.sub(/\A---\s\sbody:\s/, '').gsub(/\s\z/, '')
@@ -12,30 +12,26 @@ 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
+
15
23
  # declare needed overloaded methods here
16
24
  def authorize(auth = {})
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
25
+ auth[:login] = auth[:login] || auth[:username]
26
+ raise TaskMapper::Exception.new('Please provide at least a username') if auth[:login].blank?
27
+ provider.login = auth[:login]
28
+ provider.user_token = auth[:password] || auth[:oauth_token]
29
+ provider.api = new_github_client auth
35
30
  end
31
+
36
32
 
37
33
  def valid?
38
- TaskMapper::Provider::Github.api.authenticated?
34
+ TaskMapper::Provider::Github.api.authenticated? || TaskMapper::Provider::Github.api.oauthed?
39
35
  end
40
36
 
41
37
  end
@@ -1,9 +1,7 @@
1
1
  {
2
2
  "url": "https://api.github.com/repos/taskmapper-user/tmtest-repo/issues/comments/3951282",
3
3
  "created_at": "2012-02-13T22:49:55Z",
4
- "body": {
5
- "body": "for testing"
6
- },
4
+ "body": "for testing",
7
5
  "updated_at": "2012-02-13T22:49:55Z",
8
6
  "id": 3951282,
9
7
  "user": {
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "taskmapper-github"
8
- s.version = "0.10.1"
8
+ s.version = "0.10.2"
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 = "2012-07-17"
12
+ s.date = "2012-11-30"
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 = [
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.1
4
+ version: 0.10.2
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: 2012-07-17 00:00:00.000000000 Z
12
+ date: 2012-11-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: taskmapper
@@ -181,7 +181,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
181
  version: '0'
182
182
  segments:
183
183
  - 0
184
- hash: -233008721
184
+ hash: 1004648945
185
185
  required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  none: false
187
187
  requirements: