Sha256: ebbf00d586ca6cf32958c63f73e4e67867489374d1f63af3a69d2b273b534566

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

require 'bundler'
begin
  require 'rspec/core/rake_task'
rescue LoadError
  puts "Please install rspec (bundle install)"
  exit
end

begin
  require 'metric_fu'
  MetricFu::Configuration.run do |config|
    config.rcov[:rcov_opts] << "-Ispec"
  end
rescue LoadError
end

RSpec::Core::RakeTask.new :spec
Bundler::GemHelper.install_tasks

desc "Sanitize sensitive info from cassettes"
task :sanitize_cassettes do
  if ENV['WHM_HASH'] && ENV['WHM_HOST']
    path = File.join(File.dirname(__FILE__), 'spec', 'vcr_cassettes')
    files = Dir.glob("#{path}/**/*.yml")
    if files.any?
      files.each do |file|
        old = File.read(file)
        if old.match(/#{ENV['WHM_HASH']}|#{ENV['WHM_HOST']}/)
          puts "Sanitizing #{file}" 
          old.gsub!(ENV['WHM_HASH'], 'iscool')
          old.gsub!(ENV['WHM_HOST'], 'myhost.com')
          File.open(file, 'w') do |f|
            f.write old
          end
        end
      end
    else
      puts "Nothing to sanitize"
    end
  else
    puts "I can't sanitize without setting up WHM_HASH and WHM_HOST"
  end
end

desc  "Run all specs with rcov"
RSpec::Core::RakeTask.new(:rcov) do |t|
  t.rcov = true
  t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/,features\/}
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lumberg-1.0.0 Rakefile
lumberg-0.9.5 Rakefile