tablesalt 0.29.0 → 0.29.1

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: fe60f1950e5b372dae50b5d8dbff5c61e029dbc054662f1f0867979a2c312558
4
- data.tar.gz: 69f35a694fa593a189ed51cfd3a29ea29f21d62ba490782a01a8980788e39da0
3
+ metadata.gz: '0728064921316a39a18876f019d567fe175842e0021db39ed44184c96fa853e6'
4
+ data.tar.gz: 12594d63e88b66f2cffc3a633dcc8c72961745d24b2aca0080b0b0f988982b16
5
5
  SHA512:
6
- metadata.gz: 9a633dab77d9866b0ba8fecdf2449c0b27c9163d85d5f7b35a6f7a77dd75a1540304898d7f7a5977e09d91e78a981e868ab0ca3bea2dcc1ffa5c0761dd3946fc
7
- data.tar.gz: 312b001dee6cba22ed0bdcebe783d233ac988f99d97229dc9b526748fbb3b92c4eadb9983d952dda50d74caca42a7df9960679dc810aa20254c7a6c023957774
6
+ metadata.gz: 9615d887524c3755b23c6ab5129ee07a51c05f5e4c0ec149160ea6546d546b42a54baf108acb10cf7be453c4f319450be0360377a19970ef58a406545b3d3368
7
+ data.tar.gz: 6d26e263e7bf0cc8c8b43c8582eb5048ba5ce267fc6f7ea68ba045fce36d2c5722ca943b9637d31d8a54e49b0d5f8d7b9efa39945343c742eb19f9eb6099c9d8
data/README.md CHANGED
@@ -58,6 +58,27 @@ class MyClass
58
58
  end
59
59
  ```
60
60
 
61
+ #### Blocks
62
+ Blocks passed to class pass methods will be passed to the instance method being called, *not* initialize.
63
+ ```ruby
64
+ class MyClass
65
+ include Tablesalt::ClassPass
66
+ class_pass_method :call
67
+
68
+ def initialize(a)
69
+ @a = a
70
+ yield "called from initialize" if block_given?
71
+ end
72
+
73
+ def call
74
+ yield "called from call" if block_given?
75
+ end
76
+ end
77
+
78
+ MyClass.call(nil) { |str| puts str }
79
+ "called from call"
80
+ ```
81
+
61
82
  ### DSLAccessor
62
83
 
63
84
  TODO: write usage instructions
@@ -24,12 +24,15 @@ module Tablesalt
24
24
 
25
25
  _class_pass_methods << method
26
26
 
27
- define_singleton_method method do |*args, **attrs|
28
- # TODO: replace with ... when 2.6 support is removed
27
+ define_singleton_method method do |*args, **attrs, &block|
28
+ # TODO: remove this if branch when 2.6 support is removed
29
29
  if RUBY_VERSION < "2.7.0" && attrs.empty?
30
- new(*args).public_send(to || method)
30
+ new(*args).public_send(to || method, &block)
31
+ # TODO: remove this if branch when 2.7 support is removed
32
+ elsif RUBY_VERSION < "3.0.0" && args.empty? && attrs.empty?
33
+ new.public_send(to || method, &block)
31
34
  else
32
- new(*args, **attrs).public_send(to || method)
35
+ new(*args, **attrs).public_send(to || method, &block)
33
36
  end
34
37
  end
35
38
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Tablesalt
4
4
  # This constant is managed by spicerack
5
- VERSION = "0.29.0"
5
+ VERSION = "0.29.1"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tablesalt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.0
4
+ version: 0.29.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Minneti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-08 00:00:00.000000000 Z
11
+ date: 2022-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -76,7 +76,7 @@ metadata:
76
76
  homepage_uri: https://github.com/RubyAfterAll/spicerack/tree/main/tablesalt
77
77
  source_code_uri: https://github.com/RubyAfterAll/spicerack/tree/main/tablesalt
78
78
  changelog_uri: https://github.com/RubyAfterAll/spicerack/blob/main/tablesalt/CHANGELOG.md
79
- documentation_uri: https://www.rubydoc.info/gems/tablesalt/0.29.0
79
+ documentation_uri: https://www.rubydoc.info/gems/tablesalt/0.29.1
80
80
  post_install_message:
81
81
  rdoc_options: []
82
82
  require_paths:
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
- rubygems_version: 3.3.8
95
+ rubygems_version: 3.3.7
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Miscellaneous helper modules, POROs, and more, that standardize common behavior