master_loader 1.0.0 → 1.0.1

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: 4ddc0e0038e8c95ad39e592149b30409f08dc788ce0cf62372bcc7e0de9520e7
4
- data.tar.gz: 9d43b4ca0cc9aa2c033a8ae2e16ab2615625affd845662cb5521a3f51f9d3192
3
+ metadata.gz: 0b53788dd7b265f1d35a198b9eeae7130f9901587ae6a4cc407faacfcee0b104
4
+ data.tar.gz: 26b01fd1504202fa5c7d33c2176e8b6f11d6f88d1ba3563d4f5b5799108a2376
5
5
  SHA512:
6
- metadata.gz: a45362d3d20a2d0ec6a256e23aca67f91e27294a78d5e965e5746a15f932c23f5d6ec9d482acb990124a446955de8d0ccb6e004d09451e4eeb7a989134ed3f55
7
- data.tar.gz: ef2cf221281fc1c8507efa11757d550526bf006097080e938823a0be5efe133d4892935742cb1a8786982dcd4bc78a5c47d0e631b2a7b594a2c2c900530f0563
6
+ metadata.gz: dd8b1b14f32d52330b37f283b81229747469e985d1099032d90124d20f4c01622fdeda5a31aeb53a87fa52b1f1e78d6b9c886793588fa24c95bdd9362767d678
7
+ data.tar.gz: 3c98a152170415b655df19d555534fb87823d7e937686c5267f46b905d26fab9f1f63368b2f77398e3a7ad724faea4d714d9c0173c6aeb592debeec8b3b25446
@@ -1,4 +1,4 @@
1
1
  class MasterLoader
2
2
  # @!visibility private
3
- VERSION = "1.0.0".freeze
3
+ VERSION = "1.0.1".freeze
4
4
  end
data/lib/master_loader.rb CHANGED
@@ -7,19 +7,19 @@ class DelayedResult
7
7
 
8
8
  def then(&block)
9
9
  DelayedResult.new do
10
- block.(value!)
10
+ block.call(value!)
11
11
  end
12
12
  end
13
13
 
14
14
  def self.zip(*results, &block)
15
15
  DelayedResult.new do
16
16
  results = results.map(&:value!)
17
- block.(*results)
17
+ block.call(*results)
18
18
  end
19
19
  end
20
20
 
21
21
  def value!
22
- @value ||= @resolver.().yield_self do |val|
22
+ @value ||= @resolver.call().yield_self do |val|
23
23
  if val&.is_a?(DelayedResult)
24
24
  val.value!
25
25
  else
@@ -68,7 +68,7 @@ class MasterLoader
68
68
  @results
69
69
  else
70
70
  @fulfilled = true
71
- r = @loader_block.(@queue)
71
+ r = @loader_block.call(@queue)
72
72
  @results = if r.is_a?(DelayedResult)
73
73
  normalize_results(r.value!)
74
74
  else
metadata CHANGED
@@ -1,17 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: master_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Land
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-05 00:00:00.000000000 Z
12
- dependencies: []
13
- description: A data loading utility similar to GraphQL's data_loader. Can be used
14
- with Ruby GraphQL
11
+ date: 2021-09-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: concurrent-ruby
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
27
+ description: A data loading utility to batch loading of promises. It can be used with
28
+ graphql gem.
15
29
  email:
16
30
  - caleb@land.fm
17
31
  executables: []
@@ -22,7 +36,7 @@ files:
22
36
  - README.md
23
37
  - lib/master_loader.rb
24
38
  - lib/master_loader/version.rb
25
- homepage: https://github.com/caleb/master_loader
39
+ homepage: https://github.com/caleb/strongman
26
40
  licenses:
27
41
  - MIT
28
42
  metadata: {}
@@ -41,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
41
55
  - !ruby/object:Gem::Version
42
56
  version: '0'
43
57
  requirements: []
44
- rubygems_version: 3.0.6
58
+ rubygems_version: 3.2.22
45
59
  signing_key:
46
60
  specification_version: 4
47
61
  summary: Batch data loading, works great with graphql