file_scanner 2.0.2 → 2.0.3

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: c12f11f2f4e622c3b6004ea36c83e82e671e1395
4
- data.tar.gz: 97d4d537ec6509e2f709afd9dfd17a0977b8cc9f
3
+ metadata.gz: c1cda3e528d605e623d9fe66470b1f7da8d4291c
4
+ data.tar.gz: e621b7d514074a6e6d1ec41676181f81ae842ec1
5
5
  SHA512:
6
- metadata.gz: b6e038b6006fbbac3e25cfcf31277275b8046291c8557aee7f40cc92f554e392704014a57cdf29fca76c75ce6b9b8f2a1435b85348c5b9cd7c4947eead90ee27
7
- data.tar.gz: 2bdf24965994cda568977723d6cbaafb8d3d19a49b78679233cc1a66327cc28db8b26753720ea57d2cae247ee4a1263b56c835491b64a2e9ca7b25d35407eddf
6
+ metadata.gz: 9f0698b387845a2023e955a62351f37f02fbff19a8b5cdf4d1b388d6910a1e955dc9099a8d7325e4eb24cd6e2912901c03734ba47f3b2a657d86adf367996e66
7
+ data.tar.gz: c7628e23e403b6427b989d3e0c1ce72cac2500740877a2a83b36eccfcf497d8367a8ca94a4ee8fc0a81125db8de9d4dd990bb8c6dc22ee746e14bc9ddba1b153
data/README.md CHANGED
@@ -10,6 +10,7 @@
10
10
  * [Custom](#custom)
11
11
  * [Worker](#worker)
12
12
  * [Batches](#batches)
13
+ * [Enumerator](#enumerator)
13
14
  * [Logger](#logger)
14
15
  * [Factory](#factory)
15
16
 
@@ -88,6 +89,13 @@ worker.call do |slice|
88
89
  end
89
90
  ```
90
91
 
92
+ #### Enumerator
93
+ In case you want access the sliced enumerator directly, just do not pass a block to the method:
94
+ ```ruby
95
+ slices = worker.call
96
+ count = slices.flatten.size
97
+ ```
98
+
91
99
  #### Logger
92
100
  If you dare to trace what the worker is doing (including errors), you can specify a logger to the worker class:
93
101
  ```ruby
@@ -1,3 +1,3 @@
1
1
  module FileScanner
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
@@ -25,8 +25,9 @@ module FileScanner
25
25
  end
26
26
 
27
27
  def call
28
+ return slices unless block_given?
28
29
  slices.each do |slice|
29
- yield(slice, @logger) if block_given?
30
+ yield(slice, @logger)
30
31
  end
31
32
  rescue StandardError => e
32
33
  @logger.error { e.message }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file_scanner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - costajob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-10 00:00:00.000000000 Z
11
+ date: 2017-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler