sync_issues 0.3.0 → 0.4.0
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/lib/sync_issues/comparison.rb +7 -1
- data/lib/sync_issues/github.rb +5 -3
- data/lib/sync_issues/synchronizer.rb +1 -1
- data/lib/sync_issues/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 62af29db2b77e785b80d150ab1270f3af5a1dfac
|
|
4
|
+
data.tar.gz: 8e02ae7ba06a7d4741fb227b09f432d15ba9c331
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c90b297ae05678c0e753f6ee77b52d6696a702fb09b582b485a13db846f36cee58e1a7be933456639f5266b9df73768117995c6e7e66f9aa5d3db0c11a98351
|
|
7
|
+
data.tar.gz: e00dad87094dcbfa8dd3b82138bec5a66a1119e89f0b17a533e3844284b860a8ec0e2954c64f78a69c9c32dc051a1dde69645553d94b92315d25b5f30e8f56f8
|
|
@@ -3,10 +3,11 @@ require_relative 'error'
|
|
|
3
3
|
module SyncIssues
|
|
4
4
|
# Comparison represents differences between Issues (local and GitHub)
|
|
5
5
|
class Comparison
|
|
6
|
-
attr_reader :changed, :content, :title
|
|
6
|
+
attr_reader :assignee, :changed, :content, :title
|
|
7
7
|
|
|
8
8
|
def initialize(issue, github_issue)
|
|
9
9
|
@changed = []
|
|
10
|
+
@assignee = github_issue.assignee
|
|
10
11
|
@content = github_issue.body
|
|
11
12
|
@title = github_issue.title
|
|
12
13
|
compare(issue, github_issue)
|
|
@@ -19,6 +20,11 @@ module SyncIssues
|
|
|
19
20
|
private
|
|
20
21
|
|
|
21
22
|
def compare(issue, github_issue)
|
|
23
|
+
unless issue.assignee == (github_issue.assignee &&
|
|
24
|
+
github_issue.assignee.login)
|
|
25
|
+
@changed << 'assignee'
|
|
26
|
+
@assignee = issue.assignee
|
|
27
|
+
end
|
|
22
28
|
unless issue.new_title.nil?
|
|
23
29
|
@changed << 'title'
|
|
24
30
|
@title = issue.new_title
|
data/lib/sync_issues/github.rb
CHANGED
|
@@ -11,7 +11,8 @@ module SyncIssues
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def create_issue(repository, issue)
|
|
14
|
-
@client.create_issue(repository.full_name, issue.title, issue.content
|
|
14
|
+
@client.create_issue(repository.full_name, issue.title, issue.content,
|
|
15
|
+
assignee: issue.assignee)
|
|
15
16
|
end
|
|
16
17
|
|
|
17
18
|
def issues(repository)
|
|
@@ -26,8 +27,9 @@ module SyncIssues
|
|
|
26
27
|
raise Error, 'repository not found'
|
|
27
28
|
end
|
|
28
29
|
|
|
29
|
-
def update_issue(repository, issue_number, title, content)
|
|
30
|
-
@client.update_issue(repository.full_name, issue_number, title, content
|
|
30
|
+
def update_issue(repository, issue_number, title, content, assignee)
|
|
31
|
+
@client.update_issue(repository.full_name, issue_number, title, content,
|
|
32
|
+
assignee: assignee)
|
|
31
33
|
end
|
|
32
34
|
|
|
33
35
|
private
|
|
@@ -93,7 +93,7 @@ module SyncIssues
|
|
|
93
93
|
changed = comparison.changed.join(', ')
|
|
94
94
|
puts "Updating #{changed} on ##{github_issue.number}"
|
|
95
95
|
@github.update_issue(repository, github_issue.number, comparison.title,
|
|
96
|
-
comparison.content)
|
|
96
|
+
comparison.content, comparison.assignee)
|
|
97
97
|
end
|
|
98
98
|
end
|
|
99
99
|
end
|
data/lib/sync_issues/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sync_issues
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bryce Boe
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-02-
|
|
11
|
+
date: 2016-02-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: docopt
|