Sha256: 218edba965023c52b1788ef3036694cdfb3ad0b752e95cf9041812786afb9e7c

Contents?: true

Size: 915 Bytes

Versions: 3

Compression:

Stored size: 915 Bytes

Contents

require 'bundler/gem_tasks'

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |t|
  t.rspec_opts = %w[--color]
  t.pattern = 'spec/**/*_spec.rb'
end
task :default => :spec

task :coverage => [:coverage_env, :spec]
task :coverage_env do
  ENV['COVERAGE'] = '1'
end

task :benchmark do
  require 'benchmark'
  require 'uri'
  require File.expand_path('lib/gitable/uri', File.dirname(__FILE__))

  n = 10000
  scp = "git@github.com:martinemde/gitable.git"
  uri = "git://github.com/martinemde/gitable.git"
  dup = Gitable::URI.parse(uri)
  Benchmark.bmbm do |x|
    x.report('dup')         { n.times { Gitable::URI.parse(dup) } }
    x.report(uri)           { n.times { Gitable::URI.parse(uri) } }
    x.report(scp)           { n.times { Gitable::URI.parse(scp) } }
    x.report("addressable") { n.times { Addressable::URI.parse(uri) } }
    x.report("uri")         { n.times { URI.parse(uri) } }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gitable-0.4.0 Rakefile
gitable-0.3.1 Rakefile
gitable-0.3.0 Rakefile