trailblazer-finder 0.92.0 → 0.100.0

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: d5aa468a471c2d9bb6f7f0196e46a14905a557956a18da87723eb74a3f897b10
4
- data.tar.gz: 6d236f533affcf4eb828704e438b2ec9f30270d61626be709aa29d64c5489d5d
3
+ metadata.gz: f7b20b70b6ec1d9b476c977676905a019d5401e59ade88b7730dc9df838254c6
4
+ data.tar.gz: 137e82a841ab7bc0d92c8dd1c382b9b3ae7ea075bd1243a93002a2d4d6ebed63
5
5
  SHA512:
6
- metadata.gz: 8067cad54995bf7b42b522dc10fc3574dcb7a0a62ad3548e207785c647737192059c0193dd80420891d7e9ab0e96ae13f66c18f0edee94bd29b211139c6457b6
7
- data.tar.gz: 9da38615d6276c0c886ab89396da5e0dcf776eefe8ed8e369d439ce38af3113d477c39dee6482c28d6110a9f4e880aa0c3f4b0a704140ed419ea66a83f06b410
6
+ metadata.gz: c93fac22c96811f2a539ce7ed48e6b2adc1dc051d2844cea64d174f27f5f73b01012d0d3fa5659aa39e1ae997f60d641bab1498a85b32ad118aa2f64a075b710
7
+ data.tar.gz: b15bd4754b0cf76eaa96fb03422285a16b2cb126eb2d61eb9f399998f999394605699a54e37a07f219003d72a4c0de01b043ad11743284b4290625252cd086fe
@@ -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
@@ -7,7 +7,7 @@ module Trailblazer
7
7
  def self.included(base)
8
8
  base.include Helpers::Basic
9
9
  base.include Helpers::Sorting
10
- base.extend Finder::Dsl
10
+ base.extend Dsl
11
11
  end
12
12
 
13
13
  attr_reader :signal, :errors
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Trailblazer
4
4
  class Finder
5
- VERSION = "0.92.0"
5
+ VERSION = "0.100.0"
6
6
  end
7
7
  end
@@ -1,45 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "forwardable"
4
- require "trailblazer"
5
- require "dry-types"
6
- require "ostruct"
3
+ require 'forwardable'
4
+ require 'dry-types'
5
+ require 'ostruct'
6
+ require 'zeitwerk'
7
+ require 'trailblazer/operation'
8
+ require 'trailblazer/macro'
7
9
 
8
- require_relative "finder/utils/array"
9
- require_relative "finder/utils/hash"
10
- require_relative "finder/utils/string"
11
- require_relative "finder/utils/splitter"
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("ActiveRecord", "Sequel")
40
- ORM_ADAPTERS = EXT_ORM_ADAPTERS | Types::Strict::String.enum("Basic")
41
- PAGING_ADAPTERS = Types::Strict::String.enum("Kaminari", "WillPaginate")
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 = Trailblazer::Activity::Circuit::TaskAdapter.for_step(Finder.new, binary: true)
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"] = Trailblazer::Operation::Result.new(!finder.nil?, {})
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.92.0
4
+ version: 0.100.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
@@ -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,20 @@ dependencies:
40
54
  - - ">="
41
55
  - !ruby/object:Gem::Version
42
56
  version: 0.13.0
57
+ - !ruby/object:Gem::Dependency
58
+ name: zeitwerk
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 2.6.0
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 2.6.0
43
71
  - !ruby/object:Gem::Dependency
44
72
  name: activerecord
45
73
  requirement: !ruby/object:Gem::Requirement
@@ -217,6 +245,7 @@ executables: []
217
245
  extensions: []
218
246
  extra_rdoc_files: []
219
247
  files:
248
+ - lib/trailblazer-finder.rb
220
249
  - lib/trailblazer/finder.rb
221
250
  - lib/trailblazer/finder/activities/find.rb
222
251
  - lib/trailblazer/finder/activities/prepare.rb