Skip to content

Commit

Permalink
Ruby 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
groue committed Feb 27, 2014
1 parent 8351a0e commit 62c5b5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Scripts/GRMustacheBenchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def build
complexity = File.basename(File.dirname(File.dirname(path)))
@complexities |= [complexity]

samples = File.read(path).map { |sample_line| sample_line.strip.to_f }
samples = File.read(path).lines.map { |sample_line| sample_line.strip.to_f }
samples = numbers_in_confidence_interval(samples, 0.75) # keep 75% of the population
sample = samples.inject(&:+) / samples.count # average

Expand All @@ -103,7 +103,7 @@ def build
@sample_for_version_for_complexity_for_task[task][complexity][version] = sample
end

@versions = @versions.sort_by { |version| [-version[0], version.scan(/\d*/).delete_if(&:empty?).map { |n| '%03d' % (n.to_i) }.join.to_i] }
@versions = @versions.sort_by { |version| [-(version[0].ord), version.scan(/\d*/).delete_if(&:empty?).map { |n| '%03d' % (n.to_i) }.join.to_i] }

@complexities = @complexities.sort_by { |complexity| complexity.to_i }

Expand Down
2 changes: 1 addition & 1 deletion Scripts/build_README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require 'fileutils'
require File.join(File.dirname(__FILE__), 'GRMustacheBenchmark')
require File.join('.', File.dirname(__FILE__), 'GRMustacheBenchmark')

ROOT = File.join(File.dirname(__FILE__), '..')
plots_path = File.join(ROOT, 'Plots')
Expand Down

0 comments on commit 62c5b5d

Please sign in to comment.