batch-loader 1.2.0 → 1.2.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
  SHA1:
3
- metadata.gz: aa05684af093fc9efd4873f256fd0a173179609c
4
- data.tar.gz: 9e7e5751b5bba6b43f0cf8bce0e32fd64885a194
3
+ metadata.gz: c9c2a37ad6f642d238140812bad2ec413e220c0d
4
+ data.tar.gz: e57a956992150ef4578edb133075b4ac3b1eb741
5
5
  SHA512:
6
- metadata.gz: '08d5499226c25e153e4587358e8f38cd88950fe4d216578ea5b82b71f77ca381bd07f0383bda26e54edd56ffb4c92b458028857f1db7d770101039c548d0838e'
7
- data.tar.gz: '02913dc9ee5cc57e952ecd49a7636d275d7343990c574a3f14ff0ddf7ed662991cfdd4f8b722c0dcca54b86996d9a4377ebf4f5582075bf54670657dc8c0c30d'
6
+ metadata.gz: 024e3fc9ad27f32668f38a83260ea9f642094518f94e26144559c06240a2fe9ebe236e6028678362218276d9da8f5a603a943c712e4cb0b160ab7b7573e6fb45
7
+ data.tar.gz: 9caaea9dfeadb9d3534cf850a221a68a7296ced09c1f8aa2e5af8c13777c3eb3c2b1fae527a8d4fed351f7a38aa09a50baa1978b66c039d9acc2b77587495c6a
@@ -8,10 +8,14 @@ one of the following labels: `Added`, `Changed`, `Deprecated`,
8
8
  to manage the versions of this gem so
9
9
  that you can set version constraints properly.
10
10
 
11
- #### [Unreleased](https://github.com/exAspArk/batch-loader/compare/v1.2.0...HEAD)
11
+ #### [Unreleased](https://github.com/exAspArk/batch-loader/compare/v1.2.1...HEAD)
12
12
 
13
13
  * WIP
14
14
 
15
+ #### [v1.2.1](https://github.com/exAspArk/batch-loader/compare/v1.2.0...v1.2.1)
16
+
17
+ * `Fixed`: Do not depend on `method_missing` for `respond_to?`. [#14](https://github.com/exAspArk/batch-loader/pull/14)
18
+
15
19
  #### [v1.2.0](https://github.com/exAspArk/batch-loader/compare/v1.1.1...v1.2.0)
16
20
 
17
21
  * `Added`: `key` argument for the `BatchLoader#batch` method. [#12](https://github.com/exAspArk/batch-loader/pull/12)
@@ -36,7 +36,9 @@ class BatchLoader
36
36
  end
37
37
 
38
38
  def respond_to?(method_name, include_private = false)
39
- LEFT_INSTANCE_METHODS.include?(method_name) || method_missing(:respond_to?, method_name, include_private)
39
+ return true if LEFT_INSTANCE_METHODS.include?(method_name)
40
+
41
+ __loaded_value.respond_to?(method_name, include_private)
40
42
  end
41
43
 
42
44
  def inspect
@@ -60,6 +62,11 @@ class BatchLoader
60
62
 
61
63
  private
62
64
 
65
+ def __loaded_value
66
+ result = __sync!
67
+ @cache ? @loaded_value : result
68
+ end
69
+
63
70
  def method_missing(method_name, *args, &block)
64
71
  __sync!.public_send(method_name, *args, &block)
65
72
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class BatchLoader
4
- VERSION = "1.2.0"
4
+ VERSION = "1.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batch-loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - exAspArk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-16 00:00:00.000000000 Z
11
+ date: 2017-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler