frequency_analyser 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,6 +14,7 @@ class FrequencyAnalyser::Aggregator < Struct.new(:counter, :aggregation)
14
14
  file.each_line do |line|
15
15
  aggregation << counter.count(line)
16
16
  end
17
+ reset(file)
17
18
  end
18
19
  aggregation
19
20
  end
@@ -27,4 +28,10 @@ class FrequencyAnalyser::Aggregator < Struct.new(:counter, :aggregation)
27
28
  [files].flatten
28
29
  end
29
30
 
31
+ def reset(file)
32
+ if file.respond_to? :pos
33
+ file.pos = 0
34
+ end
35
+ end
36
+
30
37
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frequency_analyser
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 2
10
- version: 1.2.2
9
+ - 3
10
+ version: 1.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christopher Patuzzo