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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1a0eb369a76682bb73ee520c153849ae1f5ff78f8c84abf0fe23080b8caac7b
4
- data.tar.gz: 183fd8c860a0954e653068edb23ebfc671b3972f0d5c25bfb163d2654e3d922a
3
+ metadata.gz: 0de5a5c10effc047408eda530074a15d321d59a65c100962ed08bedd829a1df9
4
+ data.tar.gz: 7eaa04d703606ae3372b4b9f745a1ae5de07a59f76e132f25e3b62a639b2d508
5
5
  SHA512:
6
- metadata.gz: e8dd33702a370ee56601a4a214069c3e174fbaad4d69982c8f47a426f9f9a462035fd978220ff874a7372f98482a6530ef7dd04ea1eeb556918aca508bff834b
7
- data.tar.gz: f5c561f300d13bd795690240365f51468ed0d2e1d2ab2f42733b026a19fc319f919d33aeaaa8e18a9b83dc547677f06952ffbca79dcf0e404bca15bf1d68e529
6
+ metadata.gz: 9901cbd13070928ed326639396afa77da9e8217dcdc6a116a24dff7738a422681458e554d34bbf73d2602f6bc6cd7285e72b52ef3efbd2361dcc23d6a288e192
7
+ data.tar.gz: 46f9cdf14e601c40e3033f9cf555e3c38f27318580ce97144ef93d7d0812a167e7d1d6d412a9ddf92a37a299b0a07b1d18a6231ed1a8524dbc4ef53c83e787d0
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://github.com/xlgmokha/jive/workflows/ci/badge.svg)](https://github.com/xlgmokha/jive/actions)
4
4
 
5
- Hi!
5
+ 🐕 Woof!
6
6
 
7
7
  ## Installation
8
8
 
data/jive.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  "README.md",
21
21
  "jive.gemspec",
22
22
  "jive.sh"
23
- ]
23
+ ] + Dir["lib/**/templates/*.md"]
24
24
  spec.bindir = "exe"
25
25
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ["lib"]
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.run_each([
15
- [:mkdir, "-p", dir.parent.to_s],
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
@@ -6,7 +6,7 @@ module Jive
6
6
  cd: "/usr/bin/cd",
7
7
  echo: "/usr/bin/echo",
8
8
  git: "/usr/bin/git",
9
- mkdir: "/usr/bin/mkdir"
9
+ mkdir: "/bin/mkdir"
10
10
  }.freeze
11
11
 
12
12
  def run_each(tasks)
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jive
4
- VERSION = "0.3.2"
4
+ VERSION = "0.4.3"
5
5
  end
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.2
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-02-07 00:00:00.000000000 Z
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: