the_help 3.4.0 → 3.5.0

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: 8430824b2d2a5a8b4fdf1925b234a81c9377f5916e352c967f15b084ba546386
4
- data.tar.gz: 75a481c9cd39173aafd183ba79ee217bbce2474bcd5b1c3a7daee851cce813ba
3
+ metadata.gz: 23549e882a292bcd3a220b22e6761eca139ac452d0a5f4f7a46b318ba2702570
4
+ data.tar.gz: ab250ee41c17c458c54e9817a9cebe1781c36ce4211f7ed0bf274f4e28f63ea1
5
5
  SHA512:
6
- metadata.gz: 9398f9ade624bf4f8ff0e843c69226ea652b39f7e713722f2559bb77daaf181593a99e0f0d28f12bfcd7e0d7cf9198a8ae69383e325a03328b81ae2992a0b49f
7
- data.tar.gz: b050a8e67894e4fd5572c56cd76e0faf29269a847662ac06ca50da8d69ba1404b7793e84fe431a4fa91948edd389478d1349cde32eea6d933fd802b27918d91a
6
+ metadata.gz: 469d1d7513a3dd6cf7b6b5d9a34eb0580b0cbe3c5205996b1ef7240f8312777b4d44c17852c87ff435231c6f0d6a493588fc0f8097a9fa4e414a80fc6ba239a9
7
+ data.tar.gz: 99b3277a01c99017f2ba8f787a23a56da16a564a6a2e00ae8488f1af0e72844f100b34348c2ee2e79682f73160c3b3e4fe73497ff82bd3760d533446df88cbd9
data/.travis.yml CHANGED
@@ -2,4 +2,5 @@ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
4
  - 2.4.1
5
- before_install: gem install bundler -v 1.16.0.pre.2
5
+ - 3.0.1
6
+ before_install: gem install bundler -v 2.2.15
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- the_help (3.4.0)
4
+ the_help (3.5.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.1)
10
10
  byebug (11.1.3)
11
- diff-lcs (1.4.4)
11
+ diff-lcs (1.5.0)
12
12
  parallel (1.19.2)
13
13
  parser (2.7.2.0)
14
14
  ast (~> 2.4.1)
@@ -16,19 +16,19 @@ GEM
16
16
  rake (13.0.1)
17
17
  regexp_parser (1.8.2)
18
18
  rexml (3.2.4)
19
- rspec (3.9.0)
20
- rspec-core (~> 3.9.0)
21
- rspec-expectations (~> 3.9.0)
22
- rspec-mocks (~> 3.9.0)
23
- rspec-core (3.9.3)
24
- rspec-support (~> 3.9.3)
25
- rspec-expectations (3.9.3)
19
+ rspec (3.10.0)
20
+ rspec-core (~> 3.10.0)
21
+ rspec-expectations (~> 3.10.0)
22
+ rspec-mocks (~> 3.10.0)
23
+ rspec-core (3.10.1)
24
+ rspec-support (~> 3.10.0)
25
+ rspec-expectations (3.10.1)
26
26
  diff-lcs (>= 1.2.0, < 2.0)
27
- rspec-support (~> 3.9.0)
28
- rspec-mocks (3.9.1)
27
+ rspec-support (~> 3.10.0)
28
+ rspec-mocks (3.10.2)
29
29
  diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.9.0)
31
- rspec-support (3.9.4)
30
+ rspec-support (~> 3.10.0)
31
+ rspec-support (3.10.3)
32
32
  rubocop (0.93.1)
33
33
  parallel (~> 1.10)
34
34
  parser (>= 2.7.1.5)
@@ -56,4 +56,4 @@ DEPENDENCIES
56
56
  yard
57
57
 
58
58
  BUNDLED WITH
59
- 1.17.3
59
+ 2.2.15
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'set'
4
+
3
5
  module TheHelp
4
6
  # Adds a callback DSL to including classes
5
7
  #
@@ -129,12 +131,12 @@ module TheHelp
129
131
 
130
132
  def _provides_callbacks_define_wrapper(name, without_logging)
131
133
  make_public = public_method_defined?(name)
132
- define_method(name) do |*args|
134
+ define_method(name) do |*args, **options|
133
135
  if defined?(logger)
134
136
  logger.debug("#{self.class.name}/#{__id__} received callback " \
135
137
  ":#{name}.")
136
138
  end
137
- send(without_logging, *args)
139
+ send(without_logging, *args, **options)
138
140
  self
139
141
  end
140
142
  private name unless make_public
@@ -106,8 +106,8 @@ module TheHelp
106
106
  # Convenience method to instantiate the service and immediately call it
107
107
  #
108
108
  # Any arguments are passed to #initialize
109
- def call(*args, &block)
110
- new(*args).call(&block)
109
+ def call(*args, **options, &block)
110
+ new(*args, **options).call(&block)
111
111
  end
112
112
 
113
113
  # :nodoc:
@@ -341,17 +341,23 @@ module TheHelp
341
341
  raise TheHelp::NoResultError if result.pending?
342
342
  end
343
343
 
344
- def run_callback(callback, *args)
344
+ def run_callback(callback, *args, **options)
345
345
  continue = false
346
346
  continue = catch(:stop) do
347
- callback.call(*args)
347
+ if options.empty?
348
+ # Satisfies Ruby 2.4 and friends - where straightforward `, **options`
349
+ # still lands as separated `{}` parameter into the lambda..
350
+ callback.call(*args)
351
+ else
352
+ callback.call(*args, **options)
353
+ end
348
354
  true
349
355
  end
350
356
  self.stop_caller ||= !continue
351
357
  end
352
358
 
353
- def delegate_to_service(*args)
354
- call_service(*args) { |result| @result = result }
359
+ def delegate_to_service(*args, **options)
360
+ call_service(*args, **options) { |result| @result = result }
355
361
  end
356
362
  end
357
363
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TheHelp
4
- VERSION = '3.4.0'
4
+ VERSION = '3.5.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the_help
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Wilger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-13 00:00:00.000000000 Z
11
+ date: 2022-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -87,7 +87,6 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - ".circleci/config.yml"
91
90
  - ".gitignore"
92
91
  - ".rspec"
93
92
  - ".rubocop.yml"
data/.circleci/config.yml DELETED
@@ -1,35 +0,0 @@
1
- # Ruby CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
- #
5
- version: 2
6
- jobs:
7
- build:
8
- docker:
9
- # specify the version you desire here
10
- - image: circleci/ruby:2.4.1
11
-
12
- steps:
13
- - checkout
14
-
15
- # Download and cache dependencies
16
- - restore_cache:
17
- keys:
18
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
19
- # fallback to using the latest cache if no exact match is found
20
- - v1-dependencies-
21
-
22
- - run:
23
- name: install dependencies
24
- command: |
25
- bundle install --jobs=4 --retry=3 --path vendor/bundle
26
-
27
- - save_cache:
28
- paths:
29
- - ./vendor/bundle
30
- key: v1-dependencies-{{ checksum "Gemfile.lock" }}
31
-
32
- # run tests!
33
- - run:
34
- name: run tests
35
- command: bundle exec rspec