slayer 0.5.2 → 0.5.4
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 +4 -4
- data/.github/workflows/release.yml +2 -2
- data/.github/workflows/test.yml +3 -3
- data/Dockerfile +1 -1
- data/lib/slayer/command.rb +7 -5
- data/lib/slayer/compat/compat_040.rb +9 -7
- data/lib/slayer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a68e66d2025d43b8d41085b0f3c3b0b7a6af22c7231927fe85829afd2af0552
|
4
|
+
data.tar.gz: a12f7e965d6c51a6c2136ca72fa3256e2c7bdab67393795b8f8f603c66405e50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38c301ff78a9c2e4cbfbfbd1525fb57f4831c15dbd08518856c4062e80ed115af22544b8a7efa520eea9b2a0f773b28ed049282c4497e8c03bd8e4b2a678c0a8
|
7
|
+
data.tar.gz: 586d23d4aa0af1df2e3f96d08ce8e41b54991f2a5d0a9a05bd45ab6b4dd9b39c0ddb3b9b1530b88d019d208710c194b1191570032d9da182362ffa7b7692f425
|
@@ -9,10 +9,10 @@ jobs:
|
|
9
9
|
release:
|
10
10
|
runs-on: ubuntu-latest
|
11
11
|
steps:
|
12
|
-
- uses: actions/checkout@
|
12
|
+
- uses: actions/checkout@v4
|
13
13
|
- uses: ruby/setup-ruby@v1
|
14
14
|
with:
|
15
|
-
ruby-version: 3.
|
15
|
+
ruby-version: 3.2
|
16
16
|
- run: bundle install
|
17
17
|
- name: publish gem
|
18
18
|
run: |
|
data/.github/workflows/test.yml
CHANGED
@@ -12,12 +12,12 @@ jobs:
|
|
12
12
|
|
13
13
|
strategy:
|
14
14
|
matrix:
|
15
|
-
ruby-version: ['3.1', '3.0', '2.7']
|
15
|
+
ruby-version: ['3.3', '3.2', '3.1', '3.0', '2.7']
|
16
16
|
|
17
17
|
steps:
|
18
|
-
- uses: actions/checkout@
|
18
|
+
- uses: actions/checkout@v4
|
19
19
|
- name: Set up Ruby
|
20
|
-
uses: ruby/setup-ruby@
|
20
|
+
uses: ruby/setup-ruby@v1
|
21
21
|
with:
|
22
22
|
ruby-version: ${{ matrix.ruby-version }}
|
23
23
|
- name: Install dependencies
|
data/Dockerfile
CHANGED
data/lib/slayer/command.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
module Slayer
|
2
2
|
class Command
|
3
3
|
class << self
|
4
|
-
def call(*args, &block)
|
4
|
+
def call(*args, **kwargs, &block)
|
5
5
|
instance = self.new
|
6
6
|
|
7
|
-
res = __get_result(instance, *args, &block)
|
7
|
+
res = __get_result(instance, *args, **kwargs, &block)
|
8
8
|
handle_match(res, instance, block) if block_given?
|
9
9
|
|
10
10
|
raise CommandNotImplementedError unless res.is_a? Result
|
@@ -22,15 +22,17 @@ module Slayer
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def err!(value: nil, status: :default, message: nil)
|
25
|
-
|
25
|
+
unless ENV['SUPPRESS_SLAYER_WARNINGS']
|
26
|
+
warn '[DEPRECATION] `err!` is deprecated. Please use `return err` instead.'
|
27
|
+
end
|
26
28
|
raise ResultFailureError, err(value: value, status: status, message: message)
|
27
29
|
end
|
28
30
|
|
29
|
-
def __get_result(instance, *args, &block)
|
31
|
+
def __get_result(instance, *args, **kwargs, &block)
|
30
32
|
res = nil
|
31
33
|
|
32
34
|
begin
|
33
|
-
res = instance.call(*args, &block)
|
35
|
+
res = instance.call(*args, **kwargs, &block)
|
34
36
|
rescue ResultFailureError => e
|
35
37
|
res = e.result
|
36
38
|
end
|
@@ -4,17 +4,19 @@ module Slayer
|
|
4
4
|
class Command
|
5
5
|
class << self
|
6
6
|
def pass(value: nil, status: :default, message: nil)
|
7
|
-
warn '[DEPRECATION] `pass` is deprecated. Please use `ok` instead.'
|
7
|
+
warn '[DEPRECATION] `pass` is deprecated. Please use `ok` instead.' unless ENV['SUPPRESS_SLAYER_WARNINGS']
|
8
8
|
ok(value: value, status: status, message: message)
|
9
9
|
end
|
10
10
|
|
11
11
|
def flunk(value: nil, status: :default, message: nil)
|
12
|
-
warn '[DEPRECATION] `flunk` is deprecated. Please use `err` instead.'
|
12
|
+
warn '[DEPRECATION] `flunk` is deprecated. Please use `err` instead.' unless ENV['SUPPRESS_SLAYER_WARNINGS']
|
13
13
|
err(value: value, status: status, message: message)
|
14
14
|
end
|
15
15
|
|
16
16
|
def flunk!(value: nil, status: :default, message: nil)
|
17
|
-
|
17
|
+
unless ENV['SUPPRESS_SLAYER_WARNINGS']
|
18
|
+
warn '[DEPRECATION] `flunk!` is deprecated. Please use `return err` instead.'
|
19
|
+
end
|
18
20
|
err!(value: value, status: status, message: message)
|
19
21
|
end
|
20
22
|
end
|
@@ -26,24 +28,24 @@ module Slayer
|
|
26
28
|
|
27
29
|
class Result
|
28
30
|
def success?
|
29
|
-
warn '[DEPRECATION] `success?` is deprecated. Please use `ok?` instead.'
|
31
|
+
warn '[DEPRECATION] `success?` is deprecated. Please use `ok?` instead.' unless ENV['SUPPRESS_SLAYER_WARNINGS']
|
30
32
|
ok?
|
31
33
|
end
|
32
34
|
|
33
35
|
def failure?
|
34
|
-
warn '[DEPRECATION] `failure?` is deprecated. Please use `err?` instead.'
|
36
|
+
warn '[DEPRECATION] `failure?` is deprecated. Please use `err?` instead.' unless ENV['SUPPRESS_SLAYER_WARNINGS']
|
35
37
|
err?
|
36
38
|
end
|
37
39
|
end
|
38
40
|
|
39
41
|
class ResultMatcher
|
40
42
|
def pass(...)
|
41
|
-
warn '[DEPRECATION] `pass` is deprecated. Please use `ok` instead.'
|
43
|
+
warn '[DEPRECATION] `pass` is deprecated. Please use `ok` instead.' unless ENV['SUPPRESS_SLAYER_WARNINGS']
|
42
44
|
ok(...)
|
43
45
|
end
|
44
46
|
|
45
47
|
def fail(...)
|
46
|
-
warn '[DEPRECATION] `fail` is deprecated. Please use `err` instead.'
|
48
|
+
warn '[DEPRECATION] `fail` is deprecated. Please use `err` instead.' unless ENV['SUPPRESS_SLAYER_WARNINGS']
|
47
49
|
err(...)
|
48
50
|
end
|
49
51
|
end
|
data/lib/slayer/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slayer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wyatt Kirby
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-02-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: virtus
|
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
214
|
- !ruby/object:Gem::Version
|
215
215
|
version: '0'
|
216
216
|
requirements: []
|
217
|
-
rubygems_version: 3.
|
217
|
+
rubygems_version: 3.4.19
|
218
218
|
signing_key:
|
219
219
|
specification_version: 4
|
220
220
|
summary: A killer service layer
|