trailblazer-finder 0.2.7 → 0.3.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: 81be12acd7b9578205af33adb7c4ec7b8c3cfd5d5b14922b377c2221396ddb94
4
- data.tar.gz: 1eb13fa24716d87215c0ce14e23b4a3e748242339c833b4a402c16c5bf9b4084
3
+ metadata.gz: b9d592b6bddb7a2a1a4013bce8a5243f2f2bb095a49dbe9107e1196d54d10571
4
+ data.tar.gz: 025da1c9e5eb3457ecac611a86cba86ae571476a2d5ee7e7e7c22a935531f838
5
5
  SHA512:
6
- metadata.gz: 5efd0d9ae65bef07f8ff838f324d1421d20496e7f3b321859b580ee9057011dfc856a1dc1e631fda9f33d92ecb4da27880687b418c2e223db008062b029ec6de
7
- data.tar.gz: 74b411ad786feb26a28a01db862914e28e8746c3617ed4ca14d07e2bec9bf2f5fc9dcf657fc0bb86b6d3c62471b1c37f94f88c5eab6561e0d9d11e4bbc12a534
6
+ metadata.gz: 40e4ff1dfbd936fad7accb42f6d5496e49494b0772785518967fc75dc63d1328b8b10e5982f5574039361c2cb5fabab60f6b4814f7196fcf7328bc0d168efbfd
7
+ data.tar.gz: 94b01a12cb4b867900a1a8033761080a6c5494d72587db79fa11f6a2b3bf84778da6c2ae8ef094d067eb11bb84242eea73a8f31e5386544f6eb9c140725e2907
@@ -93,7 +93,7 @@ Lint/UnreachableCode:
93
93
  Enabled: false
94
94
  Lint/Void:
95
95
  Enabled: false
96
- Layout/AlignHash:
96
+ Layout/HashAlignment:
97
97
  EnforcedLastArgumentHashStyle: ignore_implicit
98
98
  Metrics/AbcSize:
99
99
  Max: 25
data/CHANGES.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.3.0
2
+ * Change internal context argument to symbols to match trailblazer 2.1 convention.
3
+
1
4
  # 0.2.7
2
5
  * Don't cast uuids to dates in the filters
3
6
 
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
 
3
5
  gemspec
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rspec/core/rake_task"
3
5
  require "rubocop/rake_task"
@@ -23,7 +23,6 @@ module Trailblazer
23
23
  end
24
24
 
25
25
  def process_paging(ctx)
26
- # ctx.instance_exec @paging[:current_page], @paging[:per_page], (process_filters ctx), &@paging[:handler]
27
26
  ctx.instance_exec @paging[:current_page], @paging[:per_page], (@sorting.empty? ? (process_filters ctx) : (process_sorting ctx)), &@paging[:handler]
28
27
  end
29
28
 
@@ -37,10 +37,11 @@ module Trailblazer
37
37
 
38
38
  def self.date?(date)
39
39
  return false unless
40
- date.kind_of?(::DateTime) ||
41
- date.kind_of?(::Date) ||
42
- date.kind_of?(::String)
43
- return false if date.kind_of?(::String) && date.size == 36 # Ignore uuids that could get casted to dates
40
+ date.is_a?(::DateTime) ||
41
+ date.is_a?(::Date) ||
42
+ date.is_a?(::String)
43
+ return false if date.is_a?(::String) && date.size == 36 # Ignore uuids that could get casted to dates
44
+
44
45
  date_hash = ::Date._parse(date.to_s)
45
46
  Date.valid_date?(date_hash[:year].to_i, date_hash[:mon].to_i, date_hash[:mday].to_i)
46
47
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Trailblazer
4
4
  class Finder
5
- VERSION = "0.2.7"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
@@ -8,9 +8,9 @@ module Trailblazer
8
8
 
9
9
  extension = Trailblazer::Activity::TaskWrap::Merge.new(
10
10
  Wrap::Inject::Defaults(
11
- "finder.class" => finder_class,
12
- "finder.entity" => entity,
13
- "finder.action" => action
11
+ :"finder.class" => finder_class,
12
+ :"finder.entity" => entity,
13
+ :"finder.action" => action
14
14
  )
15
15
  )
16
16
 
@@ -29,12 +29,12 @@ module Trailblazer
29
29
 
30
30
  class Builder
31
31
  def call(options, params)
32
- finder_class = options["finder.class"]
33
- entity = options["finder.entity"] || nil
34
- action = options["finder.action"] || :all
32
+ finder_class = options[:"finder.class"]
33
+ entity = options[:"finder.entity"]
34
+ action = options[:"finder.action"]
35
35
  action = :all unless %i[all single].include?(action)
36
36
 
37
- send("#{action}!", finder_class, entity, params, options["finder.action"])
37
+ send("#{action}!", finder_class, entity, params, options[:"finder.action"])
38
38
  end
39
39
 
40
40
  private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path("lib", __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require "trailblazer/finder/version"
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.2.7
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-02-21 00:00:00.000000000 Z
12
+ date: 2020-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dry-types