ree_lib 1.3.1 → 1.3.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1f6c16591891144555319888e1eb5477589fe33648d24704ee372d197544ce0
|
4
|
+
data.tar.gz: e0677f8acd6cee95f4661b2a99faf481e6586af4a56d6f2ea76cbe668ceb233a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef378e4f13aa0c1b887d1d489e5b7042455d7755056cb2fe7f56c13bdcb101b8162d5c24af6071a8bc72f17c0be4c8de269ee96150392ca387f757a9c344ff9d
|
7
|
+
data.tar.gz: 7bba651a2a9a08c93c4807d662d65957f2c987727f9088e483a846b0cc6092f6dd49131d03986704de6cc8afd0d0b972c09ac27e2c1c9e5aeab76346b6711456
|
data/Gemfile.lock
CHANGED
@@ -44,7 +44,7 @@ module ReeActions
|
|
44
44
|
|
45
45
|
alias_method(:__original_call, :call)
|
46
46
|
|
47
|
-
define_method :call do |user_access, attrs, &proc|
|
47
|
+
define_method :call do |user_access, attrs, **opts, &proc|
|
48
48
|
if self.class.const_defined?(:ActionCaster)
|
49
49
|
caster = self.class.const_get(:ActionCaster)
|
50
50
|
|
@@ -59,7 +59,7 @@ module ReeActions
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
__original_call(user_access, attrs, &proc)
|
62
|
+
__original_call(user_access, attrs, **opts, &proc)
|
63
63
|
end
|
64
64
|
|
65
65
|
nil
|
@@ -65,6 +65,45 @@ RSpec.describe ReeActions::DSL, type: [:autoclean] do
|
|
65
65
|
}.to raise_error(ReeActions::ParamError)
|
66
66
|
}
|
67
67
|
|
68
|
+
it {
|
69
|
+
module ReeActionsTest
|
70
|
+
include Ree::PackageDSL
|
71
|
+
|
72
|
+
package do
|
73
|
+
depends_on :ree_mapper
|
74
|
+
depends_on :ree_dao
|
75
|
+
end
|
76
|
+
|
77
|
+
class TestActionWithSplatOpts
|
78
|
+
include ReeActions::DSL
|
79
|
+
|
80
|
+
action :test_action_with_splat_opts
|
81
|
+
|
82
|
+
ActionCaster = build_mapper.use(:cast) do
|
83
|
+
integer :user_id
|
84
|
+
end
|
85
|
+
|
86
|
+
contract Any, ActionCaster.dto(:cast), Ksplat[password?: String], Optblock => Integer
|
87
|
+
def call(user_access, attrs, **opts, &proc)
|
88
|
+
proc.call(opts)
|
89
|
+
attrs[:user_id]
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
action = ReeActionsTest::TestActionWithSplatOpts.new
|
95
|
+
|
96
|
+
result = action.call('user_access', {user_id: 1}, password: "pass") do |opts|
|
97
|
+
expect(opts[:password]).to eq("pass")
|
98
|
+
end
|
99
|
+
|
100
|
+
expect(result).to eq(1)
|
101
|
+
|
102
|
+
expect {
|
103
|
+
ReeActionsTest::TestAction.new.call('user_access', {user_id: 'not integer'})
|
104
|
+
}.to raise_error(ReeActions::ParamError)
|
105
|
+
}
|
106
|
+
|
68
107
|
it {
|
69
108
|
module ReeActionsTest
|
70
109
|
include Ree::PackageDSL
|
data/lib/ree_lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ree_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruslan Gatiyatov
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-10-04 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: ree
|