sync_issues 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7873e9ea0bceb36eb67b8a4db5e4343de2b3ae04
4
- data.tar.gz: d6b8e6c793bb9c78426b3e5669fc4eb67d3e4273
3
+ metadata.gz: 62af29db2b77e785b80d150ab1270f3af5a1dfac
4
+ data.tar.gz: 8e02ae7ba06a7d4741fb227b09f432d15ba9c331
5
5
  SHA512:
6
- metadata.gz: fc7b40a5768fc125e814058a7aeb3ee8037bd7f6187c50eed0cead494944efb312519e0e0d821ef13984a8390a61b4e39a14bcc8ecbd4da9614e59d3c9c3782f
7
- data.tar.gz: f5b50077873172c7ee27819262005b38ec868d4ec89466adbe5fa16d9514e28c23f623bd476fd3d0e744fc600755c502eeced8dc38cfb018f8d6dd61926b7420
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
@@ -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
@@ -1,4 +1,4 @@
1
1
  # SyncIssues
2
2
  module SyncIssues
3
- VERSION = '0.3.0'.freeze
3
+ VERSION = '0.4.0'.freeze
4
4
  end
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.3.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-18 00:00:00.000000000 Z
11
+ date: 2016-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt