ninny 0.1.17 → 0.1.18

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: 911ed6720d5cd72ff5afd2b8a12e3ef1ab98aeb325cc5ddf39db0f3c9ff2fca5
4
- data.tar.gz: 9f490c34b1e2c5a090e78b4985aa5a53b02e2d788552f51512a7ed8b9ab6fe51
3
+ metadata.gz: ac4912e477ddf25380dd14cbf7dad07184c9b7f002d781e781917112f45cc013
4
+ data.tar.gz: 6a144e8bd809018812ad9f441aa39db5c7853bb3e0d9224bdc50eef1d6633f78
5
5
  SHA512:
6
- metadata.gz: e0d3d5d823fd4d7856e0a3972ede2cd5c15eb1cfb60b8d95a6257d9a1c6ecee91d259289fcc71c09733b4f0220b545d0655f944934e8a41f627107a02e6c5cb8
7
- data.tar.gz: c9a8bc0909bd2b2befb51fce77da37316b728bf79bb34aea68e655f3b2dbaad72faabee748b32f18df04f5420059f38d397fc41df6d415a795eb115fe28ea927
6
+ metadata.gz: 436dd448436ce48fe2658d08b3cc68b1aedbda86796c836131b8f9845af39507ff99c806f276edafeebe57799db7086ff667c17a509466ec83ab38df22d7796a
7
+ data.tar.gz: dedd4a379d28c591424f2c40e7255d1151a278f9e8d2b1df7269ee5996edeb9d26339bf4f41582907acba0d06733b16b698a12a2364295b237ea33c9e9659273
@@ -0,0 +1,33 @@
1
+ name: Build
2
+ on:
3
+ push:
4
+ branches: [ main ]
5
+ workflow_dispatch:
6
+
7
+ env:
8
+ REGISTRY: ghcr.io
9
+ IMAGE_NAME: ${{ github.repository }}
10
+
11
+ jobs:
12
+ docker-build:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: read
16
+ packages: write
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
20
+ with:
21
+ registry: ${{ env.REGISTRY }}
22
+ username: ${{ github.actor }}
23
+ password: ${{ secrets.GITHUB_TOKEN }}
24
+ - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
25
+ id: meta
26
+ with:
27
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
28
+ - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
29
+ with:
30
+ context: .
31
+ push: true
32
+ tags: ${{ steps.meta.outputs.tags }}
33
+ labels: ${{ steps.meta.outputs.labels }}
@@ -5,7 +5,6 @@ on:
5
5
 
6
6
  jobs:
7
7
  bundler-audit:
8
- if:
9
8
  runs-on: ubuntu-latest
10
9
  steps:
11
10
  - uses: actions/checkout@v2
@@ -21,7 +20,7 @@ jobs:
21
20
  bundler-audit
22
21
 
23
22
  if [ $? -eq 0 ]; then
24
- echo "No vulnerabilities found."
23
+ echo "No gem vulnerabilities found."
25
24
  else
26
25
  echo "Gem vulnerabilities found!"
27
26
  exit 1
@@ -1,4 +1,4 @@
1
- name: Main
1
+ name: Test
2
2
  on:
3
3
  push:
4
4
  branches: [ main ]
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.1
1
+ 3.0.2
data/Dockerfile ADDED
@@ -0,0 +1,3 @@
1
+ FROM ruby:3.0.2-alpine
2
+ RUN apk add git
3
+ RUN gem install ninny
data/README.md CHANGED
@@ -72,7 +72,6 @@ $ ninny staging_branch
72
72
 
73
73
  # To merge the current branch into the current/latest staging branch
74
74
  $ ninny stage_up
75
-
76
75
  ```
77
76
 
78
77
  At any point, `ninny help` will show the help screen.
data/lib/ninny/cli.rb CHANGED
@@ -31,6 +31,8 @@ module Ninny
31
31
 
32
32
  desc 'stage_up [PULL_REQUEST_ID]', 'Merges PR/MR into the staging branch'
33
33
  method_option :help, aliases: '-h', type: :boolean, desc: 'Display usage information'
34
+ method_option :username, aliases: '-u', type: :string,
35
+ desc: "The name of the user who is staging up; defaults to the local git config's user"
34
36
  def stage_up(pull_request_id = nil)
35
37
  if options[:help]
36
38
  invoke :help, ['stage_up']
@@ -6,7 +6,7 @@ module Ninny
6
6
  module Commands
7
7
  class PullRequestMerge < Ninny::Command
8
8
  attr_accessor :pull_request_id, :options, :pull_request
9
- attr_reader :branch_type
9
+ attr_reader :branch_type, :username
10
10
 
11
11
  def initialize(pull_request_id, options)
12
12
  @branch_type = options[:branch_type] || Ninny::Git::STAGING_PREFIX
@@ -65,7 +65,10 @@ module Ninny
65
65
  #
66
66
  # Returns a String
67
67
  def comment_body
68
- "Merged into #{branch_to_merge_into}."
68
+ user = username || determine_local_user
69
+ body = "Merged into #{branch_to_merge_into}".dup
70
+ body << " by #{user}" if user
71
+ body << '.'
69
72
  end
70
73
 
71
74
  # Public: Find the pull request
@@ -83,6 +86,11 @@ module Ninny
83
86
  def branch_to_merge_into
84
87
  @branch_to_merge_into ||= Ninny.git.latest_branch_for(branch_type)
85
88
  end
89
+
90
+ def determine_local_user
91
+ local_user_name = `git config user.name`.strip
92
+ local_user_name.empty? ? nil : local_user_name
93
+ end
86
94
  end
87
95
  end
88
96
  end
@@ -9,6 +9,7 @@ module Ninny
9
9
  def initialize(pull_request_id, options)
10
10
  super
11
11
  @branch_type = Ninny::Git::STAGING_PREFIX
12
+ @username = options[:username]
12
13
  end
13
14
  end
14
15
  end
data/lib/ninny/git.rb CHANGED
@@ -95,7 +95,7 @@ module Ninny
95
95
  rescue ::Git::GitExecuteError => e
96
96
  if e.message.include?(':fatal: A branch named') && e.message.include?(' already exists')
97
97
  puts "The local branch #{new_branch_name} already exists." \
98
- ' Please delete it manually and then run this command again.'
98
+ ' Please delete it manually and then run this command again.'
99
99
  exit 1
100
100
  end
101
101
  end
data/lib/ninny/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ninny
4
- VERSION = '0.1.17'
4
+ VERSION = '0.1.18'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ninny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dispatch Engineers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-14 00:00:00.000000000 Z
11
+ date: 2021-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -271,13 +271,15 @@ extensions: []
271
271
  extra_rdoc_files: []
272
272
  files:
273
273
  - ".github/pull_request_template.md"
274
- - ".github/workflows/main.yml"
274
+ - ".github/workflows/build.yml"
275
275
  - ".github/workflows/scheduled.yml"
276
+ - ".github/workflows/test.yml"
276
277
  - ".gitignore"
277
278
  - ".rspec"
278
279
  - ".rubocop.yml"
279
280
  - ".ruby-gemset"
280
281
  - ".ruby-version"
282
+ - Dockerfile
281
283
  - Gemfile
282
284
  - Guardfile
283
285
  - LICENSE.txt
@@ -326,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
326
328
  - !ruby/object:Gem::Version
327
329
  version: '0'
328
330
  requirements: []
329
- rubygems_version: 3.2.15
331
+ rubygems_version: 3.2.22
330
332
  signing_key:
331
333
  specification_version: 4
332
334
  summary: 'ninny (n): an foolish person, see: git'