trailblazer-finder 0.92.0 → 0.200.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trailblazer/finder/activities/prepare.rb +0 -8
- data/lib/trailblazer/finder/activities/prepare_entity.rb +1 -1
- data/lib/trailblazer/finder/activities/prepare_filters.rb +1 -1
- data/lib/trailblazer/finder/activities/prepare_params.rb +1 -1
- data/lib/trailblazer/finder/activities/prepare_properties.rb +1 -1
- data/lib/trailblazer/finder/activities/process.rb +0 -6
- data/lib/trailblazer/finder/activities/process_adapters.rb +1 -1
- data/lib/trailblazer/finder/base.rb +1 -1
- data/lib/trailblazer/finder/version.rb +1 -1
- data/lib/trailblazer/finder.rb +15 -32
- data/lib/trailblazer/operation/finder.rb +2 -2
- data/lib/trailblazer-finder.rb +1 -0
- metadata +46 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90dc16422aad1120e71229592d5754f1cddda1c4b100e5fd204d9489dbc380ff
|
4
|
+
data.tar.gz: f2ded79c05e8bf26bd3607e16bec67622209e667e3e446aec3b5c5987b9217ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60b6c26e8b09c3c9a5f833fcd46d84335961a0f633bd4d93743fe9bd69b3fedf2a7e861b2ae2e7f3ceea1d54b4cf4e1f3cab32b0159afcd794069db275a3d41a
|
7
|
+
data.tar.gz: 5af282dd278f41bf9ca9f89d34985989de777e8caa93da8a00107bd49700691e76babe4c665e70f57e1ef59897dc7cb6bbedbe9387f81da3a192a6817ac9d854
|
@@ -1,13 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "prepare_adapter"
|
4
|
-
require_relative "prepare_entity"
|
5
|
-
require_relative "prepare_properties"
|
6
|
-
require_relative "prepare_filters"
|
7
|
-
require_relative "prepare_params"
|
8
|
-
require_relative "prepare_paging"
|
9
|
-
require_relative "prepare_sorting"
|
10
|
-
|
11
3
|
module Trailblazer
|
12
4
|
class Finder
|
13
5
|
module Activities
|
@@ -1,11 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "process_adapters"
|
4
|
-
require_relative "process_predicates"
|
5
|
-
require_relative "process_paging"
|
6
|
-
require_relative "process_sorting"
|
7
|
-
require_relative "process_filters"
|
8
|
-
|
9
3
|
module Trailblazer
|
10
4
|
class Finder
|
11
5
|
module Activities
|
data/lib/trailblazer/finder.rb
CHANGED
@@ -1,45 +1,28 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
3
|
+
require 'forwardable'
|
4
|
+
require 'dry-types'
|
5
|
+
require 'ostruct'
|
6
|
+
require 'zeitwerk'
|
7
|
+
require 'trailblazer/operation'
|
8
|
+
require 'trailblazer/macro'
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
require_relative "finder/utils/extra"
|
13
|
-
require_relative "finder/adapters/active_record/predicates"
|
14
|
-
require_relative "finder/adapters/active_record/paging"
|
15
|
-
require_relative "finder/adapters/active_record/sorting"
|
16
|
-
require_relative "finder/adapters/kaminari/paging"
|
17
|
-
require_relative "finder/adapters/will_paginate/paging"
|
18
|
-
require_relative "finder/adapters/sequel/predicates"
|
19
|
-
require_relative "finder/adapters/sequel/paging"
|
20
|
-
require_relative "finder/adapters/sequel/sorting"
|
21
|
-
require_relative "finder/adapters/basic/predicates"
|
22
|
-
require_relative "finder/adapters/basic/paging"
|
23
|
-
require_relative "finder/adapters/basic/sorting"
|
24
|
-
require_relative "finder/activities/prepare"
|
25
|
-
require_relative "finder/activities/process"
|
26
|
-
require_relative "finder/activities/find"
|
27
|
-
require_relative "finder/helpers/basic"
|
28
|
-
require_relative "finder/helpers/sorting"
|
29
|
-
require_relative "finder/dsl"
|
30
|
-
require_relative "finder/find"
|
31
|
-
require_relative "finder/base"
|
32
|
-
require_relative "operation/finder"
|
10
|
+
loader = Zeitwerk::Loader.for_gem_extension(Trailblazer)
|
11
|
+
adapters = "#{__dir__}/finder/adapters"
|
12
|
+
loader.do_not_eager_load(adapters)
|
13
|
+
loader.setup
|
33
14
|
|
34
15
|
module Trailblazer
|
35
16
|
class Finder
|
36
17
|
module Types
|
37
18
|
include Dry.Types(default: :nominal)
|
38
19
|
end
|
39
|
-
EXT_ORM_ADAPTERS = Types::Strict::String.enum(
|
40
|
-
ORM_ADAPTERS = EXT_ORM_ADAPTERS | Types::Strict::String.enum(
|
41
|
-
PAGING_ADAPTERS = Types::Strict::String.enum(
|
20
|
+
EXT_ORM_ADAPTERS = Types::Strict::String.enum('ActiveRecord', 'Sequel')
|
21
|
+
ORM_ADAPTERS = EXT_ORM_ADAPTERS | Types::Strict::String.enum('Basic')
|
22
|
+
PAGING_ADAPTERS = Types::Strict::String.enum('Kaminari', 'WillPaginate')
|
42
23
|
|
43
24
|
include Base
|
44
25
|
end
|
45
26
|
end
|
27
|
+
|
28
|
+
loader.eager_load
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Trailblazer
|
2
2
|
class Operation
|
3
3
|
def self.Finder(finder_class, action = nil, entity = nil)
|
4
|
-
task =
|
4
|
+
task = Activity::Circuit::TaskAdapter.for_step(Finder.new, binary: true)
|
5
5
|
injections = [
|
6
6
|
:params,
|
7
7
|
{:"finder.class" => ->(*) { finder_class }},
|
@@ -17,7 +17,7 @@ module Trailblazer
|
|
17
17
|
builder = Finder::Builder.new
|
18
18
|
ctx[:finder] = finder = builder.call(options, options[:params])
|
19
19
|
ctx[:model] = finder # Don't like it, but somehow it's needed if contracts are loaded
|
20
|
-
ctx[:"result.finder"] =
|
20
|
+
ctx[:"result.finder"] = Result.new(!finder.nil?, {})
|
21
21
|
|
22
22
|
ctx[:"result.finder"].success?
|
23
23
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require_relative 'trailblazer/finder'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer-finder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.200.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-
|
13
|
+
date: 2024-09-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: dry-types
|
@@ -26,6 +26,20 @@ dependencies:
|
|
26
26
|
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: 1.0.0
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: trailblazer-macro
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 2.1.15
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.1.15
|
29
43
|
- !ruby/object:Gem::Dependency
|
30
44
|
name: trailblazer-activity
|
31
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -40,6 +54,34 @@ dependencies:
|
|
40
54
|
- - ">="
|
41
55
|
- !ruby/object:Gem::Version
|
42
56
|
version: 0.13.0
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: trailblazer-activity-dsl-linear
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 1.2.5
|
64
|
+
type: :runtime
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 1.2.5
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: zeitwerk
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.6.0
|
78
|
+
type: :runtime
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 2.6.0
|
43
85
|
- !ruby/object:Gem::Dependency
|
44
86
|
name: activerecord
|
45
87
|
requirement: !ruby/object:Gem::Requirement
|
@@ -217,6 +259,7 @@ executables: []
|
|
217
259
|
extensions: []
|
218
260
|
extra_rdoc_files: []
|
219
261
|
files:
|
262
|
+
- lib/trailblazer-finder.rb
|
220
263
|
- lib/trailblazer/finder.rb
|
221
264
|
- lib/trailblazer/finder/activities/find.rb
|
222
265
|
- lib/trailblazer/finder/activities/prepare.rb
|
@@ -276,7 +319,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
276
319
|
- !ruby/object:Gem::Version
|
277
320
|
version: '0'
|
278
321
|
requirements: []
|
279
|
-
rubygems_version: 3.
|
322
|
+
rubygems_version: 3.5.11
|
280
323
|
signing_key:
|
281
324
|
specification_version: 4
|
282
325
|
summary: Trailblazer based finder objects. It is designed to be used on its own as
|