geet 0.1.12 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +32 -6
  3. data/.rubocop_todo.yml +24 -1
  4. data/.travis.yml +7 -0
  5. data/Gemfile +3 -1
  6. data/Gemfile.lock +18 -0
  7. data/README.md +45 -11
  8. data/Rakefile +5 -0
  9. data/bin/geet +6 -9
  10. data/extra/issue_editing.png +0 -0
  11. data/extra/pr_editing.png +0 -0
  12. data/geet.gemspec +2 -2
  13. data/lib/geet/commandline/commands.rb +3 -1
  14. data/lib/geet/commandline/configuration.rb +37 -31
  15. data/lib/geet/commandline/editor.rb +66 -0
  16. data/lib/geet/git/repository.rb +5 -1
  17. data/lib/geet/github/abstract_issue.rb +7 -3
  18. data/lib/geet/github/api_interface.rb +9 -5
  19. data/lib/geet/github/branch.rb +15 -0
  20. data/lib/geet/github/gist.rb +1 -1
  21. data/lib/geet/github/issue.rb +1 -13
  22. data/lib/geet/github/label.rb +1 -1
  23. data/lib/geet/gitlab/api_interface.rb +9 -5
  24. data/lib/geet/helpers/os_helper.rb +8 -1
  25. data/lib/geet/resources/edit_summary_template.md +7 -0
  26. data/lib/geet/services/create_gist.rb +1 -1
  27. data/lib/geet/services/create_issue.rb +1 -1
  28. data/lib/geet/services/create_pr.rb +5 -2
  29. data/lib/geet/services/merge_pr.rb +8 -1
  30. data/lib/geet/version.rb +1 -1
  31. data/spec/integration/create_gist_spec.rb +5 -3
  32. data/spec/integration/create_issue_spec.rb +6 -3
  33. data/spec/integration/create_label_spec.rb +6 -4
  34. data/spec/integration/create_pr_spec.rb +4 -2
  35. data/spec/integration/list_issues_spec.rb +5 -3
  36. data/spec/integration/list_labels_spec.rb +4 -2
  37. data/spec/integration/list_milestones_spec.rb +3 -1
  38. data/spec/integration/list_prs_spec.rb +4 -2
  39. data/spec/integration/merge_pr_spec.rb +26 -1
  40. data/spec/spec_helper.rb +4 -2
  41. data/spec/vcr_cassettes/merge_pr_with_branch_deletion.yml +222 -0
  42. metadata +11 -3
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  require_relative '../../lib/geet/git/repository'
@@ -26,7 +28,7 @@ describe Geet::Services::CreatePr do
26
28
 
27
29
  actual_output = StringIO.new
28
30
 
29
- actual_created_pr = VCR.use_cassette("create_pr") do
31
+ actual_created_pr = VCR.use_cassette('create_pr') do
30
32
  described_class.new.execute(
31
33
  repository, 'Title', 'Description',
32
34
  label_patterns: '_bug,invalid', milestone_pattern: '0.0.1', reviewer_patterns: 'nald-ts,nald-fr',
@@ -55,7 +57,7 @@ describe Geet::Services::CreatePr do
55
57
 
56
58
  actual_output = StringIO.new
57
59
 
58
- actual_created_pr = VCR.use_cassette("create_pr_upstream") do
60
+ actual_created_pr = VCR.use_cassette('create_pr_upstream') do
59
61
  described_class.new.execute(upstream_repository, 'Title', 'Description', no_open_pr: true, output: actual_output)
60
62
  end
61
63
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  require_relative '../../lib/geet/git/repository'
@@ -19,7 +21,7 @@ describe Geet::Services::ListIssues do
19
21
 
20
22
  actual_output = StringIO.new
21
23
 
22
- service_result = VCR.use_cassette("github_com/list_issues") do
24
+ service_result = VCR.use_cassette('github_com/list_issues') do
23
25
  described_class.new.execute(repository, output: actual_output)
24
26
  end
25
27
 
@@ -41,7 +43,7 @@ describe Geet::Services::ListIssues do
41
43
 
42
44
  actual_output = StringIO.new
43
45
 
44
- service_result = VCR.use_cassette("github_com/list_issues_upstream") do
46
+ service_result = VCR.use_cassette('github_com/list_issues_upstream') do
45
47
  described_class.new.execute(upstream_repository, output: actual_output)
46
48
  end
47
49
 
@@ -64,7 +66,7 @@ describe Geet::Services::ListIssues do
64
66
 
65
67
  actual_output = StringIO.new
66
68
 
67
- service_result = VCR.use_cassette("gitlab_com/list_issues") do
69
+ service_result = VCR.use_cassette('gitlab_com/list_issues') do
68
70
  described_class.new.execute(repository, output: actual_output)
69
71
  end
70
72
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  require_relative '../../lib/geet/git/repository'
@@ -19,7 +21,7 @@ describe Geet::Services::ListLabels do
19
21
  expected_label_names = %w[bug enhancement technical_debt top_priority]
20
22
 
21
23
  actual_output = StringIO.new
22
- actual_labels = VCR.use_cassette("github.com/list_labels") do
24
+ actual_labels = VCR.use_cassette('github.com/list_labels') do
23
25
  described_class.new.execute(repository, output: actual_output)
24
26
  end
25
27
 
@@ -47,7 +49,7 @@ describe Geet::Services::ListLabels do
47
49
  expected_label_names = %w[bug confirmed critical discussion documentation enhancement suggestion support]
48
50
 
49
51
  actual_output = StringIO.new
50
- actual_labels = VCR.use_cassette("gitlab.com/list_labels") do
52
+ actual_labels = VCR.use_cassette('gitlab.com/list_labels') do
51
53
  described_class.new.execute(repository, output: actual_output)
52
54
  end
53
55
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  require_relative '../../lib/geet/git/repository'
@@ -31,7 +33,7 @@ describe Geet::Services::ListMilestones do
31
33
 
32
34
  actual_output = StringIO.new
33
35
 
34
- service_result = VCR.use_cassette("list_milestones") do
36
+ service_result = VCR.use_cassette('list_milestones') do
35
37
  described_class.new.execute(repository, output: actual_output)
36
38
  end
37
39
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  require_relative '../../lib/geet/git/repository'
@@ -18,7 +20,7 @@ describe Geet::Services::ListPrs do
18
20
 
19
21
  actual_output = StringIO.new
20
22
 
21
- service_result = VCR.use_cassette("list_prs") do
23
+ service_result = VCR.use_cassette('list_prs') do
22
24
  described_class.new.execute(repository, output: actual_output)
23
25
  end
24
26
 
@@ -40,7 +42,7 @@ describe Geet::Services::ListPrs do
40
42
 
41
43
  actual_output = StringIO.new
42
44
 
43
- service_result = VCR.use_cassette("list_prs_upstream") do
45
+ service_result = VCR.use_cassette('list_prs_upstream') do
44
46
  described_class.new.execute(upstream_repository, output: actual_output)
45
47
  end
46
48
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  require_relative '../../lib/geet/git/repository'
@@ -18,7 +20,7 @@ describe Geet::Services::MergePr do
18
20
 
19
21
  actual_output = StringIO.new
20
22
 
21
- service_result = VCR.use_cassette("merge_pr") do
23
+ service_result = VCR.use_cassette('merge_pr') do
22
24
  described_class.new.execute(repository, output: actual_output)
23
25
  end
24
26
 
@@ -27,4 +29,27 @@ describe Geet::Services::MergePr do
27
29
  expect(actual_output.string).to eql(expected_output)
28
30
  expect(actual_pr_number).to eql(expected_pr_number)
29
31
  end
32
+
33
+ it 'should merge the PR for the current branch, with branch deletion' do
34
+ allow(repository).to receive(:current_branch).and_return('mybranch')
35
+ allow(repository).to receive(:remote).with('origin').and_return('git@github.com:donaldduck/testrepo')
36
+
37
+ expected_output = <<~STR
38
+ Finding PR with head (mybranch)...
39
+ Merging PR #3...
40
+ Deleting branch mybranch...
41
+ STR
42
+ expected_pr_number = 3
43
+
44
+ actual_output = StringIO.new
45
+
46
+ service_result = VCR.use_cassette('merge_pr_with_branch_deletion') do
47
+ described_class.new.execute(repository, delete_branch: true, output: actual_output)
48
+ end
49
+
50
+ actual_pr_number = service_result.number
51
+
52
+ expect(actual_output.string).to eql(expected_output)
53
+ expect(actual_pr_number).to eql(expected_pr_number)
54
+ end
30
55
  end
data/spec/spec_helper.rb CHANGED
@@ -1,15 +1,17 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # User-defined
2
4
 
3
5
  require 'vcr'
4
6
  require 'base64'
5
7
 
6
8
  VCR.configure do |config|
7
- config.cassette_library_dir = "spec/vcr_cassettes"
9
+ config.cassette_library_dir = 'spec/vcr_cassettes'
8
10
  config.hook_into :webmock
9
11
 
10
12
  # See https://github.com/vcr/vcr/issues/201
11
13
  config.filter_sensitive_data('<GITHUB_CREDENTIALS>') do
12
- user = ""
14
+ user = ''
13
15
  api_token = ENV.fetch('GITHUB_API_TOKEN')
14
16
 
15
17
  Base64.strict_encode64("#{user}:#{api_token}")
@@ -0,0 +1,222 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.github.com/repos/donaldduck/testrepo/pulls?head=mybranch
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/vnd.github.v3+json
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - api.github.com
18
+ Authorization:
19
+ - Basic <GITHUB_CREDENTIALS>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - GitHub.com
27
+ Date:
28
+ - Sat, 23 Dec 2017 19:37:16 GMT
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Status:
34
+ - 200 OK
35
+ X-Ratelimit-Limit:
36
+ - '5000'
37
+ X-Ratelimit-Remaining:
38
+ - '4985'
39
+ X-Ratelimit-Reset:
40
+ - '1514060897'
41
+ Cache-Control:
42
+ - private, max-age=60, s-maxage=60
43
+ Vary:
44
+ - Accept, Authorization, Cookie, X-GitHub-OTP
45
+ Etag:
46
+ - W/"3c4eae32c605d321ef5b2ce6ef37e871"
47
+ X-Oauth-Scopes:
48
+ - admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook,
49
+ delete_repo, gist, notifications, repo, user
50
+ X-Accepted-Oauth-Scopes:
51
+ - ''
52
+ X-Github-Media-Type:
53
+ - github.v3; format=json
54
+ Access-Control-Expose-Headers:
55
+ - ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining,
56
+ X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
57
+ Access-Control-Allow-Origin:
58
+ - "*"
59
+ Content-Security-Policy:
60
+ - default-src 'none'
61
+ Strict-Transport-Security:
62
+ - max-age=31536000; includeSubdomains; preload
63
+ X-Content-Type-Options:
64
+ - nosniff
65
+ X-Frame-Options:
66
+ - deny
67
+ X-Xss-Protection:
68
+ - 1; mode=block
69
+ X-Runtime-Rack:
70
+ - '0.067047'
71
+ X-Github-Request-Id:
72
+ - 856A:7F5A:28B6813:4B3F6AE:5A3EB06C
73
+ body:
74
+ encoding: ASCII-8BIT
75
+ string: '[{"url":"https://api.github.com/repos/donaldduck/testrepo/pulls/3","id":159977833,"html_url":"https://github.com/donaldduck/testrepo/pull/3","diff_url":"https://github.com/donaldduck/testrepo/pull/3.diff","patch_url":"https://github.com/donaldduck/testrepo/pull/3.patch","issue_url":"https://api.github.com/repos/donaldduck/testrepo/issues/3","number":3,"state":"open","locked":false,"title":"My
76
+ PR","user":{"login":"donaldduck","id":1595356,"avatar_url":"https://avatars2.githubusercontent.com/u/1595356?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-12-23T19:34:00Z","updated_at":"2017-12-23T19:34:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ae6021263e0b8813a8bed2b5563bb80a69a1e07","assignee":{"login":"donaldduck","id":1595356,"avatar_url":"https://avatars2.githubusercontent.com/u/1595356?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"assignees":[{"login":"donaldduck","id":1595356,"avatar_url":"https://avatars2.githubusercontent.com/u/1595356?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/donaldduck/testrepo/pulls/3/commits","review_comments_url":"https://api.github.com/repos/donaldduck/testrepo/pulls/3/comments","review_comment_url":"https://api.github.com/repos/donaldduck/testrepo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/donaldduck/testrepo/issues/3/comments","statuses_url":"https://api.github.com/repos/donaldduck/testrepo/statuses/095ef8693b51fcf7a3581282d7de4f8db3b17d68","head":{"label":"donaldduck:mybranch","ref":"mybranch","sha":"095ef8693b51fcf7a3581282d7de4f8db3b17d68","user":{"login":"donaldduck","id":1595356,"avatar_url":"https://avatars2.githubusercontent.com/u/1595356?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"repo":{"id":115215754,"name":"testrepo","full_name":"donaldduck/testrepo","owner":{"login":"donaldduck","id":1595356,"avatar_url":"https://avatars2.githubusercontent.com/u/1595356?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"private":true,"html_url":"https://github.com/donaldduck/testrepo","description":null,"fork":true,"url":"https://api.github.com/repos/donaldduck/testrepo","forks_url":"https://api.github.com/repos/donaldduck/testrepo/forks","keys_url":"https://api.github.com/repos/donaldduck/testrepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/donaldduck/testrepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/donaldduck/testrepo/teams","hooks_url":"https://api.github.com/repos/donaldduck/testrepo/hooks","issue_events_url":"https://api.github.com/repos/donaldduck/testrepo/issues/events{/number}","events_url":"https://api.github.com/repos/donaldduck/testrepo/events","assignees_url":"https://api.github.com/repos/donaldduck/testrepo/assignees{/user}","branches_url":"https://api.github.com/repos/donaldduck/testrepo/branches{/branch}","tags_url":"https://api.github.com/repos/donaldduck/testrepo/tags","blobs_url":"https://api.github.com/repos/donaldduck/testrepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/donaldduck/testrepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/donaldduck/testrepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/donaldduck/testrepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/donaldduck/testrepo/statuses/{sha}","languages_url":"https://api.github.com/repos/donaldduck/testrepo/languages","stargazers_url":"https://api.github.com/repos/donaldduck/testrepo/stargazers","contributors_url":"https://api.github.com/repos/donaldduck/testrepo/contributors","subscribers_url":"https://api.github.com/repos/donaldduck/testrepo/subscribers","subscription_url":"https://api.github.com/repos/donaldduck/testrepo/subscription","commits_url":"https://api.github.com/repos/donaldduck/testrepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/donaldduck/testrepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/donaldduck/testrepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/donaldduck/testrepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/donaldduck/testrepo/contents/{+path}","compare_url":"https://api.github.com/repos/donaldduck/testrepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/donaldduck/testrepo/merges","archive_url":"https://api.github.com/repos/donaldduck/testrepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/donaldduck/testrepo/downloads","issues_url":"https://api.github.com/repos/donaldduck/testrepo/issues{/number}","pulls_url":"https://api.github.com/repos/donaldduck/testrepo/pulls{/number}","milestones_url":"https://api.github.com/repos/donaldduck/testrepo/milestones{/number}","notifications_url":"https://api.github.com/repos/donaldduck/testrepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/donaldduck/testrepo/labels{/name}","releases_url":"https://api.github.com/repos/donaldduck/testrepo/releases{/id}","deployments_url":"https://api.github.com/repos/donaldduck/testrepo/deployments","created_at":"2017-12-23T18:58:57Z","updated_at":"2017-12-23T19:00:02Z","pushed_at":"2017-12-23T19:34:00Z","git_url":"git://github.com/donaldduck/testrepo.git","ssh_url":"git@github.com:donaldduck/testrepo.git","clone_url":"https://github.com/donaldduck/testrepo.git","svn_url":"https://github.com/donaldduck/testrepo","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"donaldduck:master","ref":"master","sha":"5e27f710486bef1ffc67ac8eb53bdc7d80f77ef3","user":{"login":"donaldduck","id":1595356,"avatar_url":"https://avatars2.githubusercontent.com/u/1595356?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"repo":{"id":115215754,"name":"testrepo","full_name":"donaldduck/testrepo","owner":{"login":"donaldduck","id":1595356,"avatar_url":"https://avatars2.githubusercontent.com/u/1595356?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"private":true,"html_url":"https://github.com/donaldduck/testrepo","description":null,"fork":true,"url":"https://api.github.com/repos/donaldduck/testrepo","forks_url":"https://api.github.com/repos/donaldduck/testrepo/forks","keys_url":"https://api.github.com/repos/donaldduck/testrepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/donaldduck/testrepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/donaldduck/testrepo/teams","hooks_url":"https://api.github.com/repos/donaldduck/testrepo/hooks","issue_events_url":"https://api.github.com/repos/donaldduck/testrepo/issues/events{/number}","events_url":"https://api.github.com/repos/donaldduck/testrepo/events","assignees_url":"https://api.github.com/repos/donaldduck/testrepo/assignees{/user}","branches_url":"https://api.github.com/repos/donaldduck/testrepo/branches{/branch}","tags_url":"https://api.github.com/repos/donaldduck/testrepo/tags","blobs_url":"https://api.github.com/repos/donaldduck/testrepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/donaldduck/testrepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/donaldduck/testrepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/donaldduck/testrepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/donaldduck/testrepo/statuses/{sha}","languages_url":"https://api.github.com/repos/donaldduck/testrepo/languages","stargazers_url":"https://api.github.com/repos/donaldduck/testrepo/stargazers","contributors_url":"https://api.github.com/repos/donaldduck/testrepo/contributors","subscribers_url":"https://api.github.com/repos/donaldduck/testrepo/subscribers","subscription_url":"https://api.github.com/repos/donaldduck/testrepo/subscription","commits_url":"https://api.github.com/repos/donaldduck/testrepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/donaldduck/testrepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/donaldduck/testrepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/donaldduck/testrepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/donaldduck/testrepo/contents/{+path}","compare_url":"https://api.github.com/repos/donaldduck/testrepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/donaldduck/testrepo/merges","archive_url":"https://api.github.com/repos/donaldduck/testrepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/donaldduck/testrepo/downloads","issues_url":"https://api.github.com/repos/donaldduck/testrepo/issues{/number}","pulls_url":"https://api.github.com/repos/donaldduck/testrepo/pulls{/number}","milestones_url":"https://api.github.com/repos/donaldduck/testrepo/milestones{/number}","notifications_url":"https://api.github.com/repos/donaldduck/testrepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/donaldduck/testrepo/labels{/name}","releases_url":"https://api.github.com/repos/donaldduck/testrepo/releases{/id}","deployments_url":"https://api.github.com/repos/donaldduck/testrepo/deployments","created_at":"2017-12-23T18:58:57Z","updated_at":"2017-12-23T19:00:02Z","pushed_at":"2017-12-23T19:34:00Z","git_url":"git://github.com/donaldduck/testrepo.git","ssh_url":"git@github.com:donaldduck/testrepo.git","clone_url":"https://github.com/donaldduck/testrepo.git","svn_url":"https://github.com/donaldduck/testrepo","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/donaldduck/testrepo/pulls/3"},"html":{"href":"https://github.com/donaldduck/testrepo/pull/3"},"issue":{"href":"https://api.github.com/repos/donaldduck/testrepo/issues/3"},"comments":{"href":"https://api.github.com/repos/donaldduck/testrepo/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/donaldduck/testrepo/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/donaldduck/testrepo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/donaldduck/testrepo/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/donaldduck/testrepo/statuses/095ef8693b51fcf7a3581282d7de4f8db3b17d68"}},"author_association":"COLLABORATOR"}]'
77
+ http_version:
78
+ recorded_at: Sat, 23 Dec 2017 19:37:16 GMT
79
+ - request:
80
+ method: put
81
+ uri: https://api.github.com/repos/donaldduck/testrepo/pulls/3/merge
82
+ body:
83
+ encoding: UTF-8
84
+ string: ''
85
+ headers:
86
+ Accept-Encoding:
87
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
88
+ Accept:
89
+ - application/vnd.github.v3+json
90
+ User-Agent:
91
+ - Ruby
92
+ Host:
93
+ - api.github.com
94
+ Authorization:
95
+ - Basic <GITHUB_CREDENTIALS>
96
+ response:
97
+ status:
98
+ code: 200
99
+ message: OK
100
+ headers:
101
+ Server:
102
+ - GitHub.com
103
+ Date:
104
+ - Sat, 23 Dec 2017 19:37:17 GMT
105
+ Content-Type:
106
+ - application/json; charset=utf-8
107
+ Transfer-Encoding:
108
+ - chunked
109
+ Status:
110
+ - 200 OK
111
+ X-Ratelimit-Limit:
112
+ - '5000'
113
+ X-Ratelimit-Remaining:
114
+ - '4984'
115
+ X-Ratelimit-Reset:
116
+ - '1514060897'
117
+ Cache-Control:
118
+ - private, max-age=60, s-maxage=60
119
+ Vary:
120
+ - Accept, Authorization, Cookie, X-GitHub-OTP
121
+ Etag:
122
+ - W/"cc42d5199c8a2ad0e6d0dc1803c731a3"
123
+ X-Oauth-Scopes:
124
+ - admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook,
125
+ delete_repo, gist, notifications, repo, user
126
+ X-Accepted-Oauth-Scopes:
127
+ - ''
128
+ X-Github-Media-Type:
129
+ - github.v3; format=json
130
+ Access-Control-Expose-Headers:
131
+ - ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining,
132
+ X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
133
+ Access-Control-Allow-Origin:
134
+ - "*"
135
+ Content-Security-Policy:
136
+ - default-src 'none'
137
+ Strict-Transport-Security:
138
+ - max-age=31536000; includeSubdomains; preload
139
+ X-Content-Type-Options:
140
+ - nosniff
141
+ X-Frame-Options:
142
+ - deny
143
+ X-Xss-Protection:
144
+ - 1; mode=block
145
+ X-Runtime-Rack:
146
+ - '0.806765'
147
+ X-Github-Request-Id:
148
+ - DA30:7F59:18C523D:3332B9B:5A3EB06C
149
+ body:
150
+ encoding: ASCII-8BIT
151
+ string: '{"sha":"05e7bf92117c784e6d17194f1a07c8258bbc8d3a","merged":true,"message":"Pull
152
+ Request successfully merged"}'
153
+ http_version:
154
+ recorded_at: Sat, 23 Dec 2017 19:37:18 GMT
155
+ - request:
156
+ method: delete
157
+ uri: https://api.github.com/repos/donaldduck/testrepo/git/refs/heads/mybranch
158
+ body:
159
+ encoding: US-ASCII
160
+ string: ''
161
+ headers:
162
+ Accept-Encoding:
163
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
164
+ Accept:
165
+ - application/vnd.github.v3+json
166
+ User-Agent:
167
+ - Ruby
168
+ Host:
169
+ - api.github.com
170
+ Authorization:
171
+ - Basic <GITHUB_CREDENTIALS>
172
+ response:
173
+ status:
174
+ code: 204
175
+ message: No Content
176
+ headers:
177
+ Server:
178
+ - GitHub.com
179
+ Date:
180
+ - Sat, 23 Dec 2017 19:37:19 GMT
181
+ Content-Type:
182
+ - application/octet-stream
183
+ Status:
184
+ - 204 No Content
185
+ X-Ratelimit-Limit:
186
+ - '5000'
187
+ X-Ratelimit-Remaining:
188
+ - '4983'
189
+ X-Ratelimit-Reset:
190
+ - '1514060897'
191
+ X-Oauth-Scopes:
192
+ - admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook,
193
+ delete_repo, gist, notifications, repo, user
194
+ X-Accepted-Oauth-Scopes:
195
+ - ''
196
+ X-Github-Media-Type:
197
+ - github.v3; format=json
198
+ Access-Control-Expose-Headers:
199
+ - ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining,
200
+ X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
201
+ Access-Control-Allow-Origin:
202
+ - "*"
203
+ Content-Security-Policy:
204
+ - default-src 'none'
205
+ Strict-Transport-Security:
206
+ - max-age=31536000; includeSubdomains; preload
207
+ X-Content-Type-Options:
208
+ - nosniff
209
+ X-Frame-Options:
210
+ - deny
211
+ X-Xss-Protection:
212
+ - 1; mode=block
213
+ X-Runtime-Rack:
214
+ - '0.579537'
215
+ X-Github-Request-Id:
216
+ - DA34:7F5B:1907461:4A8AC79:5A3EB06E
217
+ body:
218
+ encoding: UTF-8
219
+ string: ''
220
+ http_version:
221
+ recorded_at: Sat, 23 Dec 2017 19:37:19 GMT
222
+ recorded_with: VCR 3.0.3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saverio Miroddi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-23 00:00:00.000000000 Z
11
+ date: 2017-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_scripting
@@ -37,18 +37,24 @@ files:
37
37
  - ".rubocop.yml"
38
38
  - ".rubocop_todo.yml"
39
39
  - ".ruby-version"
40
+ - ".travis.yml"
40
41
  - Gemfile
41
42
  - Gemfile.lock
42
43
  - LICENSE
43
44
  - README.md
45
+ - Rakefile
44
46
  - bin/geet
47
+ - extra/issue_editing.png
48
+ - extra/pr_editing.png
45
49
  - geet.gemspec
46
50
  - lib/geet/commandline/commands.rb
47
51
  - lib/geet/commandline/configuration.rb
52
+ - lib/geet/commandline/editor.rb
48
53
  - lib/geet/git/repository.rb
49
54
  - lib/geet/github/abstract_issue.rb
50
55
  - lib/geet/github/account.rb
51
56
  - lib/geet/github/api_interface.rb
57
+ - lib/geet/github/branch.rb
52
58
  - lib/geet/github/collaborator.rb
53
59
  - lib/geet/github/gist.rb
54
60
  - lib/geet/github/issue.rb
@@ -59,6 +65,7 @@ files:
59
65
  - lib/geet/gitlab/issue.rb
60
66
  - lib/geet/gitlab/label.rb
61
67
  - lib/geet/helpers/os_helper.rb
68
+ - lib/geet/resources/edit_summary_template.md
62
69
  - lib/geet/services/create_gist.rb
63
70
  - lib/geet/services/create_issue.rb
64
71
  - lib/geet/services/create_label.rb
@@ -96,6 +103,7 @@ files:
96
103
  - spec/vcr_cassettes/list_prs.yml
97
104
  - spec/vcr_cassettes/list_prs_upstream.yml
98
105
  - spec/vcr_cassettes/merge_pr.yml
106
+ - spec/vcr_cassettes/merge_pr_with_branch_deletion.yml
99
107
  homepage: https://github.com/saveriomiroddi/geet
100
108
  licenses:
101
109
  - GPL-3.0
@@ -108,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
116
  requirements:
109
117
  - - ">="
110
118
  - !ruby/object:Gem::Version
111
- version: 2.2.0
119
+ version: 2.3.0
112
120
  required_rubygems_version: !ruby/object:Gem::Requirement
113
121
  requirements:
114
122
  - - ">="