imw 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/imw/tools/extension_analyzer.rb +3 -3
- data/lib/imw/tools/summarizer.rb +1 -1
- data/spec/imw/tools/summarizer_spec.rb +2 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.14
|
@@ -93,10 +93,10 @@ module IMW
|
|
93
93
|
# @return [String]
|
94
94
|
def most_common_extension
|
95
95
|
return most_common_extension_by_size if most_common_extension_by_size == most_common_extension_by_count # no contest
|
96
|
-
count_fraction = normalized_extension_counts[most_common_extension_by_count]
|
97
|
-
size_fraction = normalized_extension_sizes[most_common_extension_by_size]
|
96
|
+
count_fraction = (normalized_extension_counts[most_common_extension_by_count] or 0.0)
|
97
|
+
size_fraction = (normalized_extension_sizes[most_common_extension_by_size] or 0.0)
|
98
98
|
return most_common_extension_by_count if count_fraction >= 0.5 and size_fraction < 0.5 # FIXME arbitrary
|
99
|
-
return most_common_extension_by_size if count_fraction < 0.5
|
99
|
+
return most_common_extension_by_size if count_fraction < 0.5 and size_fraction >= 0.5
|
100
100
|
most_common_extension_by_size # default to size
|
101
101
|
end
|
102
102
|
|
data/lib/imw/tools/summarizer.rb
CHANGED
@@ -50,7 +50,7 @@ module IMW
|
|
50
50
|
def summary
|
51
51
|
@summary ||= inputs.map do |input|
|
52
52
|
#input.guess_schema! if input.schema.nil? && input.respond_to?(:guess_schema!)
|
53
|
-
input.respond_to?(:summary) ? input.summary : {}
|
53
|
+
(input.respond_to?(:summary) ? input.summary : {}) rescue {}
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 14
|
10
|
+
version: 0.2.14
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dhruv Bansal
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-11-
|
19
|
+
date: 2010-11-23 00:00:00 -06:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|