Sha256: 29da00cf64ebc84d62a2d3cc33b9ba91545107c7ff083d11e8576c49ab1288ff

Contents?: true

Size: 1008 Bytes

Versions: 1

Compression:

Stored size: 1008 Bytes

Contents

namespace 'gem' do
  require 'bundler/gem_tasks'
end

def run cmd
  output = `#{cmd}`
  raise output unless $? == 0
end

namespace :compile do
  desc 'build telldus-core mock'
  task 'telldus_core' do
    Dir.chdir('spec/mocks/telldus-mock') do
      run "ruby extconf.rb > /dev/null"
      run "make"
      symlink "../telldus_state.so", "./lib/telldus_state.so", {force: true}
      symlink "../telldus_state.so", "./lib/libtelldus-core.so", {force: true}
      ENV['LD_LIBRARY_PATH']="spec/mocks/telldus-mock/lib:#{ENV['LD_LIBRARY_PATH']}"
    end
  end

  desc 'build rtelldus for testing'
  task 'telldus:test' => 'telldus_core' do
    Dir.chdir('ext/rbtelldus') do
      run "ruby extconf.rb --with-telldus-dir=../../spec/mocks/telldus-mock"
      run "make"
    end
  end

  desc 'build telldus'
  task :telldus do
    Dir.chdir('lib/rbtelldus/ext') do
      run "ruby extconf.rb"
      run "make"
    end
  end
end

desc 'run tests'
task :test => [:'compile:telldus:test'] do
  sh "rspec -f d"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rbtelldus-0.1.1 Rakefile