github_issue_branch 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 587e69f3cbc52105661ce6b75eb603319efe15df
4
- data.tar.gz: d53b94c4fa4dfe65a71ee644ad9d3818bfd3158c
3
+ metadata.gz: 744f2fdc287ee1279fe368c6fe87b4d066c10259
4
+ data.tar.gz: 00b77bf71e4dbe59c9cd5de336dd320f49246630
5
5
  SHA512:
6
- metadata.gz: ed2211bc10a0409e442a23c051001e1ad15ec00960612a6c2301f4a66258b8049ed94a8695eab375951ef32ab0a5b72653cb0d3d3d6e6e20e018e263145fcfdd
7
- data.tar.gz: d4904d8342a8b0d0dd9583fe9cd91c252ae93bcadc0a803c805112b08f46937451c294dd20bb727d2f232364da785ec0ae36768b7a25d0f1cdf29f184af401a8
6
+ metadata.gz: 722a3f18c03390327a06e41614957124f95cf06bb33143329ea11319e6b059cae5f5de2b431827d06278c077aa7f339cfbe2252655e26a7a9d0d67efd1a3e20f
7
+ data.tar.gz: 4f5fa3aa95a218bf540a6aab6ed21894d2e5cf8b8450725e3904fec85f97025895c4fef893df7e1251251ff0316c623247adfb417a7776050098ee57319ba6cc
@@ -36,7 +36,6 @@ class GithubIssueBranch
36
36
  end
37
37
 
38
38
  def get_issue_list
39
- # TODO: read this from either config file or from git remotes
40
39
  list = @github.issues.list user: @github_repo_owner, repo: @github_repo
41
40
  list.select { |issue| issue['pull_request'].nil? }
42
41
  end
@@ -47,7 +46,7 @@ class GithubIssueBranch
47
46
  print_list issue_list
48
47
  issue = choose_issue issue_list
49
48
  # TODO: Fix the assignee as if owner is an organization it is wrong
50
- @github.issues.edit @github_repo_owner, @github_repo, issue.number, assignee: @github_repo_owner
49
+ @github.issues.edit @github_repo_owner, @github_repo, issue.number, assignee: @github_username
51
50
  GitUtils.create_branch(StringUtils.branch_sanitize issue.title, issue.number)
52
51
  end
53
52
 
@@ -67,6 +66,7 @@ class GithubIssueBranch
67
66
  private
68
67
 
69
68
  def load_configs
69
+ @github_username = @github.users.get.login
70
70
  @github_token = read_conf 'github_auth_token', 'GITHUB_AUTH_TOKEN'
71
71
  owner, repo = GitUtils.get_remote_user_repo('origin')
72
72
  @github_repo_owner = read_conf('github_owner') || owner
@@ -13,12 +13,10 @@ class GitUtils
13
13
  get_remote(name).url
14
14
  end
15
15
 
16
- # TODO: Use regex to extract values instead?
17
16
  def self.get_remote_user_repo name
18
17
  url = get_remote_url(name)
19
- username_repository = url.split(':')[1]
20
- username_repository.slice! '.git'
21
- username_repository.split '/'
18
+ repo_owner_name = /.*github.com[:|\/](.*).git/.match(url).captures
19
+ repo_owner_name.first.split '/'
22
20
  end
23
21
 
24
22
  def self.create_branch name
@@ -1,3 +1,3 @@
1
1
  module GithubIssueBranch
2
- VERSION='0.0.2'
2
+ VERSION='0.0.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_issue_branch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rui Baltazar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-11 00:00:00.000000000 Z
11
+ date: 2016-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github_api