gub 0.1.1 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 072a3b63a77778a8d2f979c9f4d6d615c8ea3a77
4
- data.tar.gz: 8facd31ac70710e31b364c474b0c490dec99f26f
3
+ metadata.gz: 13347212ee0df95482e921cd191da7ecec690901
4
+ data.tar.gz: a1800e5d9860ec2b824a6c1c17bcfba05efbe5e9
5
5
  SHA512:
6
- metadata.gz: d871b22b656b16454ba840246a6aabf4f1bb867118b32d019604f44f0c17d427b0ef6a6d763c86a7b692b66bfa151f565dba26150ae2d790ececbe9baa44c85a
7
- data.tar.gz: 6e1bea14e32327df9ad57507c5d61b2a48c03dc5bfcbc33d8d704151c23c55ff64894e3ce7bfd2868d8416e59a3902ce3324e9939404df29902d344af3145bd6
6
+ metadata.gz: ae93c287218cc9747f73002cc90b4646531b90a79ba900a6b579b64f1b4c0f15828318b257e75e1029a2ab87d149ae842ae0213b6afa6b150020e55a0544b7c6
7
+ data.tar.gz: b3adbc543bc3042f632dfd73eb5a54b0c9eca7c2efa4436129b6228aefe425924b8aa77d553334d1bcb13f3dc0e469806100615c44e1940f5f75bc6bdc676d09
data/bin/gub CHANGED
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  debug = false
4
+ if ENV.include?('GUB_ENV') && ENV['GUB_ENV'] == 'development'
5
+ debug = true
6
+ $:<< File.expand_path("~/Projects/gub/lib/")
7
+ end
4
8
 
5
9
  require 'gub'
6
10
  # Start our command line interface
@@ -98,11 +98,11 @@ module Gub
98
98
  Gub.log.fatal "Unable to guess issue ID from branch name. You might want to specify it explicitly."
99
99
  exit 1
100
100
  else
101
- issue = Gub.github.issue(repo, id)
101
+ repository = Repository.new
102
102
  Gub.log.info 'Pushing branch...'
103
103
  Gub.git.push('origin', "issue-#{id}")
104
104
  Gub.log.info "Creating pull-request for issue ##{id}..."
105
- Gub.github.create_pull_request_for_issue(repo, 'master', "#{user_name}:issue-#{id}", id)
105
+ repository.issue_pull_request(id)
106
106
  Gub.git.checkout('master')
107
107
  end
108
108
  end
@@ -51,6 +51,16 @@ module Gub
51
51
  Gub.github.update_issue name, issue.number, issue.title, issue.body, { assignee: assignee }
52
52
  end
53
53
 
54
+ def issue_pull_request id
55
+ issue = self.issue(id)
56
+ if self.has_issues?
57
+ repo = self.full_name
58
+ else
59
+ repo = self.parent
60
+ end
61
+ Gub.github.create_pull_request_for_issue(repo, 'master', "#{self.owner}:issue-#{id}", id)
62
+ end
63
+
54
64
  def owner
55
65
  @full_name.split('/').first
56
66
  end
@@ -1,3 +1,3 @@
1
1
  module Gub
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Omar Abdel-Wahab