yuuki 0.1.5 → 0.1.7
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/lib/yuuki/caller.rb +11 -0
- data/lib/yuuki/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d008fa930697e3248e20acbc34df7cfcdbd1abbd9bd25ea21cea696e43aafd6d
|
4
|
+
data.tar.gz: 8a30c007f19d4215c96e5acd6ad427875411cb4d5f057cbe612e3c081d6cfec2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0014990d77135e9d2d93b07580d999b2694b645319cbf8d227938b2fb94f55239d3dff57db10ec6f3c6cd9dd5a99005e47d257c7a96bb8b9f4f62c0c240e3dc
|
7
|
+
data.tar.gz: e7275a43d674ef004158731998c577d751dcc72d4054238592d1d0e438af2744bba4465902a5f330e7fa174a531c498e7770654581356b9f08d0fc989d473493
|
data/lib/yuuki/caller.rb
CHANGED
@@ -77,10 +77,21 @@ module Yuuki
|
|
77
77
|
run_internal(runners.select(&proc_select), args, &block)
|
78
78
|
end
|
79
79
|
|
80
|
+
# set whether to ignore ``tag not associated'' error
|
81
|
+
def ignore_tag_error(enabled: true)
|
82
|
+
@ignore_tag_error = enabled
|
83
|
+
end
|
84
|
+
|
80
85
|
# runs all methods with the specified tags
|
81
86
|
# @param [Symbol] tags
|
82
87
|
# @param [Object] args arguments
|
83
88
|
def run_tag(*tags, **args, &block)
|
89
|
+
t = self.tags
|
90
|
+
tags.each do |e|
|
91
|
+
next if t.include?(e)
|
92
|
+
raise Yuuki::Error, "tag `#{e}` is not associated" unless @ignore_tag_error
|
93
|
+
warn "Yuuki Warning: tag `#{e}` is not associated"
|
94
|
+
end
|
84
95
|
run_select(proc{|_method, meta| meta[:tags]&.intersect?(tags)}, **args, &block)
|
85
96
|
end
|
86
97
|
|
data/lib/yuuki/version.rb
CHANGED