ree_lib 1.3.1 → 1.3.3

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: e0af4ff1ff0131d5bc74585d771be2081d44e0cee58cf3776e2ae74c7347c103
4
- data.tar.gz: 7d1ee4448f3863c953cc9702f2da111cd23d6aea10946dafda1ede944798afb8
3
+ metadata.gz: 5c2344653424e4b4597e82d6bb4f02ba3c93e577ab81a5afad986b1b54f34bdf
4
+ data.tar.gz: 8eab2fc67b9f6076fccffa8fe7cab45a0bd5b6f64bf80792d98e0d1556935c84
5
5
  SHA512:
6
- metadata.gz: '093189cd86d7fb01efcb761fbd4a7d0dd1ffe4b02a5c1132899a28aeca9b2bcf1b8a7873e00cab91f3a9f47e12ff2992e9a9fdd45de2481bcf14a592d278592e'
7
- data.tar.gz: c43e1011b66f1e82b59b4f31b0b48c2ca0d8d232bf801bc740592bba49b6a3862b8a4c4646a060f52b514e0bc9c47202f548bcfe9a73bb59a25219bb4d230ed8
6
+ metadata.gz: 58c9002d50cab923ada784de99b8447c456145e5d0c497e1c04fec753c47652e50e912eea067dfa929156f4a0d396c36e5de068a940cd5baaa74f4564182c597
7
+ data.tar.gz: 5dd9f09f9953f3b3101449225847c22dfda247bf4f60cac42c8e9d4a1dfab783b65a21d780cda6964502b454d6a279fcb0c5a22e3cce0e9a0515d28f06b6d230
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ree_lib (1.3.1)
4
+ ree_lib (1.3.3)
5
5
  bigdecimal (~> 3.1.9)
6
6
  binding_of_caller (~> 1.0.1)
7
7
  i18n (~> 1.14.7)
@@ -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
@@ -47,7 +47,7 @@ class Roda
47
47
  message = <<~DOC
48
48
  Request/Response details:
49
49
  Request: #{env["REQUEST_METHOD"]} #{env["QUERY_STRING"] && !env["QUERY_STRING"].empty? ? env["SCRIPT_NAME"].to_s + env["PATH_INFO"] + "?#{env["QUERY_STRING"]}": env["SCRIPT_NAME"].to_s + env["PATH_INFO"]} #{opts[:ree_logger_log_params] ? "\n Params: " + request.params.inspect : ""}
50
- Response status: #{response.status || "-"}#{(400..499).include?(response.status) ? "\n Response body: " + response.body[0] : ""}
50
+ Response status: #{response.status || "-"}#{(400..499).include?(response.status) ? "\n Response body: " + response.body[0].to_s : ""}
51
51
  Time Taken: #{elapsed_time}
52
52
  DOC
53
53
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReeLib
4
- VERSION = "1.3.1"
4
+ VERSION = "1.3.3"
5
5
  end
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.1
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-06-16 00:00:00.000000000 Z
10
+ date: 2025-10-05 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: ree