geet 0.3.16 → 0.3.17

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
  SHA256:
3
- metadata.gz: 15603a9a3a61fd8b6c3a377bd8fb1f482c121078b153e0cb8f3bdf12609d01f2
4
- data.tar.gz: cde2b52ebcc17f2af2e64466c5565a65fad846e946747d91dfd734e5ce108e2c
3
+ metadata.gz: a475adafa9bb0791266b171ea0e8ba05caf076227f1d3b68efe75697479c2cca
4
+ data.tar.gz: e63c7d8d46c3f44b0962ee1c3445e3aaf076f03b41f218bfde957779decfd445
5
5
  SHA512:
6
- metadata.gz: 5ea5d57a2f25a0f83910afe316194d335f11d04b4228324ab577845a74b62331705b3650b654cdb951e69c6fa76438441e1fa1caa3bf431e456acefc39f4457d
7
- data.tar.gz: 06c954789d0e39cb723daa45de62c190817773cad1c29d1719524452c98731ded5f0cce8f72450f677c54688c38636b21538eca04226dafb45b00d16ab548806
6
+ metadata.gz: 1d19fde0bb7c9733ee7aaea4c249378077d242c56f92055f29c1f3eb27e200de06890f2d5e97c76a58ffc604c46674ceddd8fc349b17907cee89fdfabbd029c0
7
+ data.tar.gz: dbdad4b310621f063af44aabfe71fb485232a836085c5729a057d350911408db3e3dd18e7a40459ceb80d4cae000f279ceaf2798a1eaf9f6caeab7b704da3fa8
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  /.ruby-version
2
2
  /.ruby-gemset
3
3
  /Gemfile.lock
4
+ /test_repos
@@ -6,6 +6,7 @@ rvm:
6
6
  - 2.5
7
7
  - 2.6
8
8
  - 2.7
9
+ - 3.0
9
10
  - ruby-head
10
11
  matrix:
11
12
  fast_finish: true
data/bin/geet CHANGED
@@ -28,22 +28,22 @@ class GeetLauncher
28
28
  filename = options.delete(:filename)
29
29
  options[:publik] = options.delete(:public) if options.key?(:public)
30
30
 
31
- Services::CreateGist.new.execute(filename, options)
31
+ Services::CreateGist.new.execute(filename, **options)
32
32
  when ISSUE_CREATE_COMMAND
33
33
  summary = options[:summary] || Commandline::Editor.new.edit_content(help: SUMMARY_TEMPLATE)
34
34
  title, description = split_summary(summary)
35
35
 
36
36
  options = default_to_manual_selection(options, :labels, :milestone, :assignees)
37
37
 
38
- Services::CreateIssue.new(repository).execute(title, description, options)
38
+ Services::CreateIssue.new(repository).execute(title, description, **options)
39
39
  when LABEL_CREATE_COMMAND
40
40
  name = options.delete(:name)
41
41
 
42
- Services::CreateLabel.new(repository).execute(name, options)
42
+ Services::CreateLabel.new(repository).execute(name, **options)
43
43
  when ISSUE_LIST_COMMAND
44
44
  options = default_to_manual_selection(options, :assignee)
45
45
 
46
- Services::ListIssues.new(repository).execute(options)
46
+ Services::ListIssues.new(repository).execute(**options)
47
47
  when LABEL_LIST_COMMAND
48
48
  Services::ListLabels.new(repository).execute
49
49
  when MILESTONE_CLOSE_COMMAND
@@ -52,7 +52,7 @@ class GeetLauncher
52
52
  #
53
53
  options = {numbers: Shared::Selection::MANUAL_LIST_SELECTION_FLAG}
54
54
 
55
- Services::CloseMilestones.new(repository).execute(options)
55
+ Services::CloseMilestones.new(repository).execute(**options)
56
56
  when MILESTONE_CREATE_COMMAND
57
57
  title = options.delete(:title)
58
58
 
@@ -62,20 +62,20 @@ class GeetLauncher
62
62
  when PR_COMMENT_COMMAND
63
63
  comment = options.delete(:comment)
64
64
 
65
- Services::CommentPr.new(repository).execute(comment, options)
65
+ Services::CommentPr.new(repository).execute(comment, **options)
66
66
  when PR_CREATE_COMMAND
67
67
  summary = options[:summary] || edit_pr_summary(base: options[:base])
68
68
  title, description = split_summary(summary)
69
69
 
70
70
  options = default_to_manual_selection(options, :labels, :milestone, :reviewers)
71
71
 
72
- Services::CreatePr.new(repository).execute(title, description, options)
72
+ Services::CreatePr.new(repository).execute(title, description, **options)
73
73
  when PR_LIST_COMMAND
74
74
  Services::ListPrs.new(repository).execute
75
75
  when PR_MERGE_COMMAND
76
- Services::MergePr.new(repository).execute(options)
76
+ Services::MergePr.new(repository).execute(**options)
77
77
  when PR_OPEN_COMMAND
78
- Services::OpenPr.new(repository).execute(options)
78
+ Services::OpenPr.new(repository).execute(**options)
79
79
  else
80
80
  raise "Internal error - Unrecognized command #{command.inspect}"
81
81
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.required_ruby_version = '>= 2.3.0'
12
12
  s.authors = ['Saverio Miroddi']
13
- s.date = '2020-11-16'
13
+ s.date = '2021-01-18'
14
14
  s.email = ['saverio.pub2@gmail.com']
15
15
  s.homepage = 'https://github.com/saveriomiroddi/geet'
16
16
  s.summary = 'Commandline interface for performing SCM host operations, eg. create a PR on GitHub'
@@ -123,7 +123,11 @@ module Geet
123
123
  raise "The functionality invoked (#{class_name}.#{meth}) is not currently supported!"
124
124
  end
125
125
 
126
- klass.send(meth, *args)
126
+ # Can't use ruby2_keywords, because the method definitions use named keyword arguments.
127
+ #
128
+ kwargs = args.last.is_a?(Hash) ? args.pop : {}
129
+
130
+ klass.send(meth, *args, **kwargs)
127
131
  else
128
132
  raise "The class referenced (#{full_class_name}) is not currently supported!"
129
133
  end
@@ -5,7 +5,7 @@ module Geet
5
5
  class Branch
6
6
  # See https://developer.github.com/v3/git/refs/#delete-a-reference
7
7
  #
8
- def self.delete(name, api_interface)
8
+ def self.delete(name, api_interface, **)
9
9
  api_path = "git/refs/heads/#{name}"
10
10
 
11
11
  api_interface.send_request(api_path, http_method: :delete)
@@ -6,7 +6,7 @@ module Geet
6
6
  autoload :AbstractIssue, File.expand_path('abstract_issue', __dir__)
7
7
 
8
8
  class Issue < Geet::Github::AbstractIssue
9
- def self.create(title, description, api_interface)
9
+ def self.create(title, description, api_interface, **)
10
10
  api_path = 'issues'
11
11
  request_data = { title: title, body: description, base: 'master' }
12
12
 
@@ -11,7 +11,7 @@ module Geet
11
11
  end
12
12
 
13
13
  # Returns a flat list of names in string form.
14
- def self.list(api_interface)
14
+ def self.list(api_interface, **)
15
15
  api_path = 'labels'
16
16
  response = api_interface.send_request(api_path, multipage: true)
17
17
 
@@ -24,7 +24,7 @@ module Geet
24
24
  end
25
25
 
26
26
  # See https://developer.github.com/v3/issues/labels/#create-a-label
27
- def self.create(name, color, api_interface)
27
+ def self.create(name, color, api_interface, **)
28
28
  api_path = 'labels'
29
29
  request_data = { name: name, color: color }
30
30
 
@@ -24,7 +24,7 @@ module Geet
24
24
  end
25
25
 
26
26
  # See https://developer.github.com/v3/issues/milestones/#create-a-milestone
27
- def self.create(title, api_interface)
27
+ def self.create(title, api_interface, **)
28
28
  api_path = 'milestones'
29
29
  request_data = { title: title }
30
30
 
@@ -39,7 +39,7 @@ module Geet
39
39
 
40
40
  # See https://developer.github.com/v3/issues/milestones/#get-a-single-milestone
41
41
  #
42
- def self.find(number, api_interface)
42
+ def self.find(number, api_interface, **)
43
43
  api_path = "milestones/#{number}"
44
44
 
45
45
  response = api_interface.send_request(api_path)
@@ -53,7 +53,7 @@ module Geet
53
53
 
54
54
  # See https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository
55
55
  #
56
- def self.list(api_interface)
56
+ def self.list(api_interface, **)
57
57
  api_path = 'milestones'
58
58
 
59
59
  response = api_interface.send_request(api_path, multipage: true)
@@ -71,7 +71,7 @@ module Geet
71
71
  #
72
72
  # This is a convenience method; the underlying operation is a generic update.
73
73
  #
74
- def self.close(number, api_interface)
74
+ def self.close(number, api_interface, **)
75
75
  api_path = "milestones/#{number}"
76
76
  request_data = { state: STATE_CLOSED }
77
77
 
@@ -45,7 +45,7 @@ module Geet
45
45
 
46
46
  # See https://developer.github.com/v3/users/#get-the-authenticated-user
47
47
  #
48
- def self.authenticated(api_interface)
48
+ def self.authenticated(api_interface, **_)
49
49
  api_path = '/user'
50
50
 
51
51
  response = api_interface.send_request(api_path)
@@ -55,7 +55,7 @@ module Geet
55
55
 
56
56
  # Returns an array of User instances
57
57
  #
58
- def self.list_collaborators(api_interface)
58
+ def self.list_collaborators(api_interface, **)
59
59
  api_path = 'collaborators'
60
60
  response = api_interface.send_request(api_path, multipage: true)
61
61
 
@@ -11,7 +11,7 @@ module Geet
11
11
  end
12
12
 
13
13
  # Returns a flat list of names in string form.
14
- def self.list(api_interface)
14
+ def self.list(api_interface, **)
15
15
  api_path = "projects/#{api_interface.path_with_namespace(encoded: true)}/labels"
16
16
  response = api_interface.send_request(api_path, multipage: true)
17
17
 
@@ -24,7 +24,7 @@ module Geet
24
24
  end
25
25
 
26
26
  # See https://docs.gitlab.com/ee/api/labels.html#create-a-new-label
27
- def self.create(name, color, api_interface)
27
+ def self.create(name, color, api_interface, **)
28
28
  api_path = "projects/#{api_interface.path_with_namespace(encoded: true)}/labels"
29
29
  request_data = { name: name, color: "##{color}" }
30
30
 
@@ -17,7 +17,7 @@ module Geet
17
17
 
18
18
  # See https://docs.gitlab.com/ee/api/milestones.html#list-project-milestones
19
19
  #
20
- def self.list(api_interface)
20
+ def self.list(api_interface, **)
21
21
  api_path = "projects/#{api_interface.path_with_namespace(encoded: true)}/milestones"
22
22
 
23
23
  response = api_interface.send_request(api_path, multipage: true)
@@ -13,7 +13,7 @@ module Geet
13
13
 
14
14
  # Returns an array of User instances
15
15
  #
16
- def self.list_collaborators(api_interface)
16
+ def self.list_collaborators(api_interface, **)
17
17
  api_path = "projects/#{api_interface.path_with_namespace(encoded: true)}/members"
18
18
 
19
19
  response = api_interface.send_request(api_path, multipage: true)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Geet
4
- VERSION = '0.3.16'
4
+ VERSION = '0.3.17'
5
5
  end
@@ -59,7 +59,7 @@ describe Geet::Services::CreateIssue do
59
59
 
60
60
  actual_created_issue = VCR.use_cassette('create_issue_upstream') do
61
61
  create_options = { no_open_issue: true, out: actual_output }
62
- described_class.new(upstream_repository, out: actual_output).execute('Title', 'Description', create_options)
62
+ described_class.new(upstream_repository, out: actual_output).execute('Title', 'Description', **create_options)
63
63
  end
64
64
 
65
65
  expect(actual_output.string).to eql(expected_output)
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.3.16
4
+ version: 0.3.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saverio Miroddi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-16 00:00:00.000000000 Z
11
+ date: 2021-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_scripting
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  requirements: []
190
- rubygems_version: 3.0.8
190
+ rubygems_version: 3.1.2
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: Commandline interface for performing SCM host operations, eg. create a PR