Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 42 lines (31 sloc) 0.847 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
require 'rbconfig'
require 'ftools'

begin
  require 'rubygems'
rescue Exception
end

begin
 require 'spec/rake/spectask'

 Spec::Rake::SpecTask.new do |t|
    t.spec_opts = ['-c']
    t.libs << 'lib'
    t.spec_files = FileList['spec/**/*_spec.rb']
    t.rcov = false
  end
rescue Exception
  puts 'RSpec not available. Install it with: sudo gem install rspec'
end

include Config

task :install do

  sitedir = CONFIG['sitelibdir']
  rmodbus_dest = File.join(sitedir, 'rmodbus')

  File::makedirs(rmodbus_dest, true)
  File::chmod(0755, rmodbus_dest)

  files = Dir.chdir('lib') { Dir['**/*.rb'] }

  files.each do |fn|
    fn_dir = File.dirname(fn)
    target_dir = File.join(sitedir, fn_dir)
    File::makedirs(target_dir) unless File.exist?(target_dir)
    File::install(File.join('lib', fn), File.join(sitedir, fn), 0644, true)
  end

end
Something went wrong with that request. Please try again.