slayer 0.5.2 → 0.5.4

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: 8afcb532ebe21d444e89baf763a76b20cf4ab19ad1bf51d45bfbd29042f3ec16
4
- data.tar.gz: 5f77a3a44acf2cd3a2888f38e67963b22866c5c81a44a628be1c28128d128812
3
+ metadata.gz: 7a68e66d2025d43b8d41085b0f3c3b0b7a6af22c7231927fe85829afd2af0552
4
+ data.tar.gz: a12f7e965d6c51a6c2136ca72fa3256e2c7bdab67393795b8f8f603c66405e50
5
5
  SHA512:
6
- metadata.gz: f383e130f4d8bef5d42f9de29db7890f585c8116f3f6ea093cb83fc3c8b29b608ee82b16e881130527adedaf36761e216985d8b13208abac93bfef74739d53c7
7
- data.tar.gz: 2b96b3b9473ad470033138e8f201a6fc5cdc893c2724fa4e0de1a0c7e820af93256d91569fe67f2a36dc66191f0956cf5ba45c11394e6d7778d015ee2633e7cb
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@v2
12
+ - uses: actions/checkout@v4
13
13
  - uses: ruby/setup-ruby@v1
14
14
  with:
15
- ruby-version: 3.0.0
15
+ ruby-version: 3.2
16
16
  - run: bundle install
17
17
  - name: publish gem
18
18
  run: |
@@ -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@v3
18
+ - uses: actions/checkout@v4
19
19
  - name: Set up Ruby
20
- uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
20
+ uses: ruby/setup-ruby@v1
21
21
  with:
22
22
  ruby-version: ${{ matrix.ruby-version }}
23
23
  - name: Install dependencies
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:3.1.2-alpine
1
+ FROM ruby:3.2-alpine
2
2
 
3
3
  RUN apk add --no-cache --update \
4
4
  bash \
@@ -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
- warn '[DEPRECATION] `err!` is deprecated. Please use `return err` instead.'
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
- warn '[DEPRECATION] `flunk!` is deprecated. Please use `return err` instead.'
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
@@ -1,3 +1,3 @@
1
1
  module Slayer
2
- VERSION = '0.5.2'
2
+ VERSION = '0.5.4'
3
3
  end
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.2
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: 2023-02-09 00:00:00.000000000 Z
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.2.3
217
+ rubygems_version: 3.4.19
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: A killer service layer