Sha256: a7242e92c7370ff9bdc566168955431c540f60721deddc3e73a9d1ad33a49d39

Contents?: true

Size: 844 Bytes

Versions: 3

Compression:

Stored size: 844 Bytes

Contents

require_relative 'lib/hoosegow'

require 'rspec/core/rake_task'

begin
  require_relative 'config'
rescue LoadError
  CONFIG = {}
end

inmate_dir = File.join(File.dirname(__FILE__), 'spec', 'test_inmate')
CONFIG[:inmate_dir] = inmate_dir
CONFIG[:image_name] = Hoosegow.new(CONFIG).image_name

RSpec::Core::RakeTask.new(:spec)
Rake::Task[:spec].prerequisites << :bootstrap_docker
task :default => :spec

def hoosegow
  @hoosgow ||= Hoosegow.new CONFIG
end

desc "Benchmark render_reverse run in docker"
task :benchmark => :bootstrap_docker do
  10.times do |i|
    sleep 0.5
    start = Time.now
    hoosegow.render_reverse "foobar"
    puts "render_reverse run ##{i} took #{Time.now - start} seconds"
  end
  hoosegow.cleanup
end

desc "Building docker image."
task :bootstrap_docker do
  hoosegow.build_image unless hoosegow.image_exists?
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hoosegow-1.2.2 Rakefile
hoosegow-1.2.1 Rakefile
hoosegow-1.2.0 Rakefile