require "bundler/gem_tasks" require "rake/testtask" require "coffee_script" require 'fileutils' Rake::TestTask.new(:test) do |t| t.libs << "test" t.libs << "lib" t.test_files = FileList['test/**/*_test.rb'] end task :build do |t| # compile the coffeescript source into vanilla js File.open('lib/generators/kurento_rails/templates/javascript/kurento-rails-js/kurento-rails.js', 'w') do |f| f.write CoffeeScript.compile(File.open("src/kurento-rails.coffee")) end FileUtils.cp 'src/kurento_controller.rb', 'lib/generators/kurento_rails/templates/controllers/kurento_controller.rb' FileUtils.cp 'src/kurento_websockets_controller.rb', 'lib/generators/kurento_rails/templates/controllers/kurento_websockets_controller.rb' FileUtils.cp 'src/events.rb', 'lib/generators/kurento_rails/templates/config/events.rb' FileUtils.cp 'src/kurento_rails_video_stream.rb', 'lib/generators/kurento_rails/templates/models/kurento_rails_video_stream.rb' end task :default => :build