transrate 0.0.14 → 0.0.15

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: 79b8d1951413bfb0b963855ab5b12608cf49fb90
4
- data.tar.gz: 575b1c9388baf5ab3d77f80dba6be422366b19e7
3
+ metadata.gz: 691eaf0cbf7a2273841277680178a34cd0801bd7
4
+ data.tar.gz: 1a84acd029aa35ae1e89b39ad8fed7c08397aed0
5
5
  SHA512:
6
- metadata.gz: 8f297dda8778d631c8642ba036a1c4c6404ecb7b77c424de2ddd39832b254be4e9f2181fac85023e6c6ed64d0dfb039253b0620f3acecddfab881db329386725
7
- data.tar.gz: 490db983381c51a7ba2fdda4f1e108dbef9546ee5f3e1307cb1cc548166230000ef3147e8b1acd23475b47c8c0b4ef64d6677ee6dc9194afa1582987d7bba748
6
+ metadata.gz: 9b6ed04d9d95a3997585051ca38d427b4f47385097258e7fe60dc040a222dbd372373d9ed246163dc1d2fac5fa4d2e5e0f8397c2b6702258ec6ce3340510bc01
7
+ data.tar.gz: 95bec4a0beb4bd1a7d94a81ec94a91f06f3f9bb8e07bbe8f85450a6f31d65d0ab938a3d40b462999e21eecf02759e1e796fa2593de7970b5d2f09e50e4e39f98
data/bin/transrate CHANGED
@@ -36,7 +36,16 @@ EOS
36
36
  end
37
37
 
38
38
  def pretty_print_hash hash, width
39
- hash.map{ |k, v| "#{k.to_s}#{" " * (width - (k.length + v.to_f.round(2).to_s.length))}#{v.to_f.round(2)}" }.join("\n")
39
+ hash.map do |k, v|
40
+ # show as float if there are any decimal places
41
+ if v.to_f.round(2).to_s.split('.').last.to_i > 0
42
+ v = v.to_f.round(2)
43
+ end
44
+ pad = (width - (k.to_s.length + v.to_s.length))
45
+ "#{k.to_s.split('_').join(' ')}" +
46
+ "#{" " * pad}" +
47
+ "#{v}"
48
+ end.join("\n")
40
49
  end
41
50
 
42
51
  include Transrate
@@ -89,7 +98,6 @@ if opts.reference
89
98
  puts "\nCalculating comparative metrics..."
90
99
  t0 = Time.now
91
100
  comparative_metrics = transrater.comparative_metrics
92
- p comparative_metrics.comp_stats
93
101
  comparative_results = comparative_metrics.comp_stats
94
102
 
95
103
  if comparative_results
@@ -4,7 +4,6 @@ module Transrate
4
4
 
5
5
  def self.dimension_reduce(metrics)
6
6
  total = 0
7
- p metrics
8
7
  metrics.each do |metric|
9
8
  o = metric.origin
10
9
  w = metric.weighting
@@ -68,7 +68,6 @@ module Transrate
68
68
  # what is this method trying to do? :/
69
69
  def results_to_hits results
70
70
  hits = {}
71
- puts "<results_to_hits> results.size = #{results.size}"
72
71
  results.each do |hit|
73
72
  if hits.has_key? hit.query
74
73
  old_hit = hits[hit.query]
@@ -10,7 +10,7 @@ module Transrate
10
10
  module VERSION
11
11
  MAJOR = 0
12
12
  MINOR = 0
13
- PATCH = 14
13
+ PATCH = 15
14
14
  BUILD = nil
15
15
 
16
16
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-26 00:00:00.000000000 Z
11
+ date: 2014-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake