jive 0.3.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/jive.gemspec +1 -1
- data/lib/jive.rb +2 -0
- data/lib/jive/cli.rb +6 -0
- data/lib/jive/git.rb +3 -5
- data/lib/jive/pull_request.rb +32 -0
- data/lib/jive/shell.rb +1 -1
- data/lib/jive/templates/pull_request_template.md +51 -0
- data/lib/jive/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0de5a5c10effc047408eda530074a15d321d59a65c100962ed08bedd829a1df9
|
4
|
+
data.tar.gz: 7eaa04d703606ae3372b4b9f745a1ae5de07a59f76e132f25e3b62a639b2d508
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9901cbd13070928ed326639396afa77da9e8217dcdc6a116a24dff7738a422681458e554d34bbf73d2602f6bc6cd7285e72b52ef3efbd2361dcc23d6a288e192
|
7
|
+
data.tar.gz: 46f9cdf14e601c40e3033f9cf555e3c38f27318580ce97144ef93d7d0812a167e7d1d6d412a9ddf92a37a299b0a07b1d18a6231ed1a8524dbc4ef53c83e787d0
|
data/README.md
CHANGED
data/jive.gemspec
CHANGED
data/lib/jive.rb
CHANGED
@@ -2,12 +2,14 @@
|
|
2
2
|
|
3
3
|
require "fileutils"
|
4
4
|
require "open3"
|
5
|
+
require "uri"
|
5
6
|
|
6
7
|
require "jive/batch_runner"
|
7
8
|
require "jive/docker"
|
8
9
|
require "jive/git"
|
9
10
|
require "jive/popen"
|
10
11
|
require "jive/project"
|
12
|
+
require "jive/pull_request"
|
11
13
|
require "jive/runner"
|
12
14
|
require "jive/shell"
|
13
15
|
require "jive/version"
|
data/lib/jive/cli.rb
CHANGED
@@ -74,6 +74,12 @@ module Jive
|
|
74
74
|
.bootstrap(Jive.shell)
|
75
75
|
end
|
76
76
|
|
77
|
+
desc "pr URL", "pull request"
|
78
|
+
def pr(url)
|
79
|
+
pr = PullRequest.new(url)
|
80
|
+
pr.edit(ENV["EDITOR"])
|
81
|
+
end
|
82
|
+
|
77
83
|
desc "setup", "provide instructions to integrate into shell"
|
78
84
|
def setup
|
79
85
|
print "source #{::Jive.root.join("jive.sh")}"
|
data/lib/jive/git.rb
CHANGED
@@ -11,12 +11,10 @@ module Jive
|
|
11
11
|
def clone(slug, host: "github.com")
|
12
12
|
dir = target_dir_for(slug, host: host)
|
13
13
|
unless dir.exist?
|
14
|
-
shell.
|
15
|
-
|
16
|
-
[:git, "clone", "git@#{host}:#{slug}", dir]
|
17
|
-
])
|
14
|
+
shell.execute([:mkdir, "-p", dir.parent.to_s])
|
15
|
+
shell.execute([:git, "clone", "git@#{host}:#{slug}", dir])
|
18
16
|
end
|
19
|
-
cd(slug, host: host)
|
17
|
+
cd(slug, host: host) if dir.exist?
|
20
18
|
end
|
21
19
|
|
22
20
|
def cd(slug, host: "github.com")
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Jive
|
4
|
+
class PullRequest
|
5
|
+
attr_reader :dir, :uri
|
6
|
+
|
7
|
+
def initialize(url)
|
8
|
+
@uri = URI.parse(url)
|
9
|
+
@dir = Pathname(Dir.home).join(".jive").join(uri.host).join(uri.path[1..-1])
|
10
|
+
Jive.shell.execute([:mkdir, "-p", @dir]) unless @dir.exist?
|
11
|
+
end
|
12
|
+
|
13
|
+
def edit(editor)
|
14
|
+
Jive.shell.execute([editor, readme.to_s])
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def template
|
20
|
+
Jive.root.join("lib/jive/templates/pull_request_template.md")
|
21
|
+
end
|
22
|
+
|
23
|
+
def readme
|
24
|
+
@readme ||=
|
25
|
+
begin
|
26
|
+
dir.join("README.md").tap do |readme|
|
27
|
+
readme.write(template.read) unless readme.exist?
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/jive/shell.rb
CHANGED
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
title: "Pull Request Template"
|
3
|
+
checklist:
|
4
|
+
- [ ] Clear description explaining the relevancy of the contribution.
|
5
|
+
- [ ] Unit, integration, and system tests.
|
6
|
+
- [ ] Regression and bugs are covered with tests.
|
7
|
+
- [ ] [Performance guidelines](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)
|
8
|
+
- [ ] [Secure coding guidelines](https://docs.gitlab.com/ee/development/secure_coding_guidelines.html)
|
9
|
+
- [ ] Documentation Updated
|
10
|
+
---
|
11
|
+
|
12
|
+
# Why is this needed?
|
13
|
+
|
14
|
+
## What does this do?
|
15
|
+
|
16
|
+
<!--
|
17
|
+
Include a summary of the change and which issue is fixed.
|
18
|
+
Include relevant motivation and context.
|
19
|
+
List any dependencies that are required for this change.
|
20
|
+
-->
|
21
|
+
|
22
|
+
Fixes # (issue)
|
23
|
+
|
24
|
+
### Screenshots
|
25
|
+
|
26
|
+
Before:
|
27
|
+
|
28
|
+
![Before][before]
|
29
|
+
|
30
|
+
After:
|
31
|
+
|
32
|
+
![After][after]
|
33
|
+
|
34
|
+
## Type of change
|
35
|
+
|
36
|
+
<!-- Delete options that are not relevant. -->
|
37
|
+
|
38
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
39
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
40
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
41
|
+
- [ ] This change requires a documentation update
|
42
|
+
|
43
|
+
## Verification Plan
|
44
|
+
|
45
|
+
<!-- How are we going to verify this change? -->
|
46
|
+
|
47
|
+
- [ ] Step 1
|
48
|
+
- [ ] Step 2
|
49
|
+
|
50
|
+
[after]: https://user-images.githubusercontent.com/x/y.png
|
51
|
+
[before]: https://user-images.githubusercontent.com/x/y.png
|
data/lib/jive/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mo khan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -114,8 +114,10 @@ files:
|
|
114
114
|
- lib/jive/git.rb
|
115
115
|
- lib/jive/popen.rb
|
116
116
|
- lib/jive/project.rb
|
117
|
+
- lib/jive/pull_request.rb
|
117
118
|
- lib/jive/runner.rb
|
118
119
|
- lib/jive/shell.rb
|
120
|
+
- lib/jive/templates/pull_request_template.md
|
119
121
|
- lib/jive/version.rb
|
120
122
|
homepage: https://rubygems.org/gems/jive
|
121
123
|
licenses:
|