geet 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/geet +13 -7
- data/geet.gemspec +1 -1
- data/lib/geet/services/abstract_create_issue.rb +0 -12
- data/lib/geet/services/create_issue.rb +0 -3
- data/lib/geet/services/create_pr.rb +0 -3
- data/lib/geet/version.rb +1 -1
- data/spec/integration/create_pr_spec.rb +1 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2ebbfe0a429595d3584630edcde97a281aaa6482e9c3815c051af46b09c9630
|
4
|
+
data.tar.gz: 63840e956153e2301874e18531e1888e97b6b6d5b9d1f5c7e41d5263bee0433b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c78a72b2f9a876fed2b7647f5dd37a3f183a183562e5f4622921b3ab6b61bdc80e8eccb0b5f38a0ab7999a9f193a209197cff8b7174c0abd769f554f1f7ed93
|
7
|
+
data.tar.gz: e9f5a7eba5d9bac198c5a2b354727472318c18aad9a849004fb97c12dfd103deb08254868e929a502a4b75c32360c9f26ddc1dec8cac060a56134805de37ebd3
|
data/bin/geet
CHANGED
@@ -17,6 +17,7 @@ class GeetLauncher
|
|
17
17
|
include Geet::Helpers::SummaryHelper
|
18
18
|
|
19
19
|
SUMMARY_TEMPLATE = IO.read(File.expand_path('../lib/geet/resources/templates/edit_summary.md', __dir__))
|
20
|
+
SUMMARY_BACKUP = File.join(Dir.tmpdir, 'last_geet_edited_summary.md')
|
20
21
|
|
21
22
|
def launch
|
22
23
|
command, options = Commandline::Configuration.new.decode_argv || exit
|
@@ -93,14 +94,19 @@ class GeetLauncher
|
|
93
94
|
git = Utils::GitClient.new
|
94
95
|
pr_commits = git.cherry(base: base)
|
95
96
|
|
96
|
-
|
97
|
-
|
98
|
-
|
97
|
+
summary =
|
98
|
+
if pr_commits.size == 1
|
99
|
+
prepopulated_summary = git.show_description('HEAD')
|
100
|
+
cancel_pr_help = "In order to cancel the PR creation, delete the description above.\n"
|
99
101
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
102
|
+
Commandline::Editor.new.edit_content(content: prepopulated_summary, help: SUMMARY_TEMPLATE + cancel_pr_help)
|
103
|
+
else
|
104
|
+
Commandline::Editor.new.edit_content(help: SUMMARY_TEMPLATE)
|
105
|
+
end
|
106
|
+
|
107
|
+
IO.write(SUMMARY_BACKUP, summary)
|
108
|
+
|
109
|
+
summary
|
104
110
|
end
|
105
111
|
|
106
112
|
def default_to_manual_selection(options, *params)
|
data/geet.gemspec
CHANGED
@@ -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 = '2021-
|
13
|
+
s.date = '2021-10-26'
|
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'
|
@@ -12,22 +12,10 @@ module Geet
|
|
12
12
|
class AbstractCreateIssue
|
13
13
|
include Geet::Helpers::OsHelper
|
14
14
|
|
15
|
-
SUMMARY_BACKUP_FILENAME = File.join(Dir.tmpdir, 'last_geet_edited_summary.md')
|
16
|
-
|
17
15
|
def initialize(repository, out: $stdout)
|
18
16
|
@repository = repository
|
19
17
|
@out = out
|
20
18
|
end
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
def save_summary(title, description)
|
25
|
-
summary = "#{title}\n\n#{description}".strip + "\n"
|
26
|
-
|
27
|
-
IO.write(SUMMARY_BACKUP_FILENAME, summary)
|
28
|
-
|
29
|
-
@out.puts "Error! Saved summary to #{SUMMARY_BACKUP_FILENAME}"
|
30
|
-
end
|
31
19
|
end
|
32
20
|
end
|
33
21
|
end
|
data/lib/geet/version.rb
CHANGED
@@ -117,10 +117,6 @@ describe Geet::Services::CreatePr do
|
|
117
117
|
allow(git_client).to receive(:working_tree_clean?).and_return(false)
|
118
118
|
allow(git_client).to receive(:remote).with(no_args).and_return('git@github.com:donaldduck/testrepo_f')
|
119
119
|
|
120
|
-
expected_output = <<~STR
|
121
|
-
Error! Saved summary to /tmp/last_geet_edited_summary.md
|
122
|
-
STR
|
123
|
-
|
124
120
|
actual_output = StringIO.new
|
125
121
|
|
126
122
|
operation = -> do
|
@@ -129,8 +125,7 @@ describe Geet::Services::CreatePr do
|
|
129
125
|
end
|
130
126
|
|
131
127
|
expect(operation).to raise_error(RuntimeError, 'The working tree is not clean!')
|
132
|
-
|
133
|
-
expect(actual_output.string).to eql(expected_output)
|
128
|
+
expect(actual_output.string).to be_empty
|
134
129
|
end
|
135
130
|
|
136
131
|
it 'should push to the remote branch' do
|
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.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saverio Miroddi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simple_scripting
|