Sha256: 8626c281498c4792831485c941a8fc8d347f46d594a206c8d9d5fa54ae6e3714

Contents?: true

Size: 1014 Bytes

Versions: 1

Compression:

Stored size: 1014 Bytes

Contents

require 'bundler/gem_tasks'

require 'cucumber/rake/task'
require 'spec/rake/spectask'

desc "Profile ascii-data-cat"
task :profile do
  lib_path = File.expand_path("#{File.dirname(__FILE__)}/lib")
  $LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
  
  require 'ascii-data-tools'
  require 'ruby-prof'
  require 'stringio'

  result = RubyProf.profile do
    orig_stdout = $stdout
    
    # redirect stdout to /dev/null
    STDOUT = File.new('/dev/null', 'w')
    
    AsciiDataTools::Controller::CatController.new(['examples/big']).run
    
    # restore stdout
    STDOUT = orig_stdout
  end
  profile = StringIO.new
  RubyProf::FlatPrinter.new(result).print(profile)
  profile.rewind
  puts profile.readlines[0..30]
end

desc "Run all storytests"
Cucumber::Rake::Task.new(:features) do |t|
  t.cucumber_opts = "features --format pretty" 
end

desc "Run all examples"
Spec::Rake::SpecTask.new(:spec) do |t|
  t.spec_files = FileList['spec/**/*_spec.rb']
end

task :default => [:spec, :features]

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ascii-data-tools-0.9 Rakefile