gotsha 1.1.2 → 1.2.0

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: c3a4f52cfc935cebef5d7ef1b3c8b5d7a47cfd1ab8e1c19a8da7f99e367f3d53
4
- data.tar.gz: a071da5be867b95a3eb8ab8c7462e75b45f87435ce2417213e07cc4a105ebf52
3
+ metadata.gz: b545ae6785a2b5315dabee560bc0cbb4fd7b158c12cd170f3e745997f5ad34a2
4
+ data.tar.gz: e77dae022f8deb64bf69898e96e0b11f96ab7e07a1547753fff22a7d81beea65
5
5
  SHA512:
6
- metadata.gz: 312c71aa07da097887c161131fbaaa7da9050a2f925e335847f02fb3bbfd24114fff4eb5d2cf55fdac0bceb7ea1e4cb03f9d6d84b9b1e11325a9eb60b13e06f7
7
- data.tar.gz: d1bd26abb492627fca22a620e64df2d4dde4223cedc06dbf186c2ed3dbfa9537a68d57022a8b7eb76e97e4ea180c118636b04a33d35e512ba5ba1d2c680bbab2
6
+ metadata.gz: 2b54c38fb51f04609aaa0d974c6feb20bf8f1ea7c89155ba5ee0168afb647e7b9de8498fdcb370bb038fa414a21e78d17ed9bc61664c832ba4a38dbf986940d9
7
+ data.tar.gz: fdfee8a01725b7f2b2ddca40636f2a5b29466c9196dcf0449ab2e0264eb67321f3a5ff0c53d0795edc92cf82d63722c222dad8fe512b3323f98b2f1cfaddbf80
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.2.0] - 2025-10-26
2
+
3
+ - Support `gotsha version` (and `-v` and `--version`)
4
+ - `gotsha --help` is not supported too
5
+ - Relax the required TOML version (it does not matter that much here, and some people reported they had issues with the 3 version required)
6
+ - Remove a leftover old GH action example
7
+
1
8
  ## [1.1.2] - 2025-10-25
2
9
 
3
10
  - Add less intrusive GitLab CI config file generation (to not overwrite existing one)
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
- <a href="https://rubygems.org/gems/gotsha"><img src="https://badge.fury.io/rb/gotsha.svg?icon=si%3Arubygems" /></a>
2
-
1
+ <a href="https://rubygems.org/gems/gotsha"><img src="https://badge.fury.io/rb/gotsha.svg?icon=si%3Arubygems&refresh=1" /></a>
3
2
  # Gotsha — your local testing CI
4
3
  Pushing untested commits? Gotsha!
5
4
 
@@ -5,6 +5,7 @@ module Gotsha
5
5
  SKIP_CONFIG_VERIFICATION_FOR = %w[init configure uninstall].freeze
6
6
  DEFAULT_ACTION = "help"
7
7
  HELP_ACTION_SHORTCUT = "-h"
8
+ VERSION_ACTION_SHORTCUT = "-v"
8
9
 
9
10
  def self.call(action_name = DEFAULT_ACTION, *args)
10
11
  action_name ||= DEFAULT_ACTION
@@ -20,6 +21,7 @@ module Gotsha
20
21
  action_class.new.call(*args)
21
22
  rescue ArgumentError
22
23
  return Actions::Help.new.call(action_name) if args == [HELP_ACTION_SHORTCUT]
24
+ return Actions::Help.new.call(action_name) if args == ["--help"]
23
25
 
24
26
  raise Errors::HardFail, "too many arguments"
25
27
  end
@@ -47,9 +49,12 @@ module Gotsha
47
49
  end
48
50
 
49
51
  def action_class
50
- Kernel.const_get("Gotsha::Actions::#{action_name.to_s.capitalize}")
52
+ class_name = action_name.to_s.delete_prefix("--").capitalize
53
+
54
+ Kernel.const_get("Gotsha::Actions::#{class_name}")
51
55
  rescue NameError
52
56
  return Gotsha::Actions::Help if action_name.to_s == HELP_ACTION_SHORTCUT
57
+ return Actions::Version if action_name.to_s == VERSION_ACTION_SHORTCUT
53
58
 
54
59
  raise Errors::HardFail, "unknown command `#{action_name}`. See available commands via `gotsha help`."
55
60
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gotsha
4
+ module Actions
5
+ class Version
6
+ DESCRIPTION = "returns Gotsha version"
7
+
8
+ def call
9
+ VERSION
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gotsha
4
- VERSION = "1.1.2"
4
+ VERSION = "1.2.0"
5
5
  end
data/lib/gotsha.rb CHANGED
@@ -11,9 +11,10 @@ require_relative "gotsha/actions/help"
11
11
  require_relative "gotsha/actions/init"
12
12
  require_relative "gotsha/actions/push"
13
13
  require_relative "gotsha/actions/show"
14
+ require_relative "gotsha/actions/status"
14
15
  require_relative "gotsha/actions/test"
15
16
  require_relative "gotsha/actions/uninstall"
16
- require_relative "gotsha/actions/status"
17
+ require_relative "gotsha/actions/version"
17
18
  require_relative "gotsha/bash_command"
18
19
  require_relative "gotsha/config"
19
20
  require_relative "gotsha/errors"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gotsha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitek Meloun
@@ -13,16 +13,16 @@ dependencies:
13
13
  name: toml-rb
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '3.0'
18
+ version: '2.0'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - "~>"
23
+ - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '3.0'
25
+ version: '2.0'
26
26
  email:
27
27
  - vitek@meloun.info
28
28
  executables:
@@ -31,7 +31,6 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
33
  - ".gotsha/config.toml"
34
- - ".gotsha/github_action_example.yml"
35
34
  - ".gotsha/hooks/post-commit"
36
35
  - ".gotsha/hooks/pre-push"
37
36
  - ".rspec"
@@ -53,6 +52,7 @@ files:
53
52
  - lib/gotsha/actions/status.rb
54
53
  - lib/gotsha/actions/test.rb
55
54
  - lib/gotsha/actions/uninstall.rb
55
+ - lib/gotsha/actions/version.rb
56
56
  - lib/gotsha/bash_command.rb
57
57
  - lib/gotsha/config.rb
58
58
  - lib/gotsha/errors.rb
@@ -1,29 +0,0 @@
1
- # If you want to create Github Action, copy this file into .gihtub folder
2
- # For example to: .github/workflows/main.yml
3
- name: Gotsha
4
-
5
- on:
6
- pull_request:
7
-
8
- jobs:
9
- verify:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - uses: actions/checkout@v4
13
- with:
14
- fetch-depth: 0
15
- ref: ${{ github.event.pull_request.head.sha }}
16
-
17
- - name: Fetch gotsha notes
18
- run: git fetch origin 'refs/notes/gotsha:refs/notes/gotsha'
19
-
20
- - name: Verify gotsha note
21
- run: |
22
- SHA="${{ github.event.pull_request.head.sha }}"
23
- NOTE="$(git notes --ref=gotsha show "$SHA" 2>/dev/null || true)"
24
- if [ "$NOTE" = "ok" ]; then
25
- echo "✓ gotsha verified for $SHA"
26
- else
27
- echo "::error ::Missing gotsha note for $SHA"
28
- exit 1
29
- fi