Sha256: 5cf3fb398d668a968178e1abc7961473790d155b798ae9a9aee24a0e75fbea60

Contents?: true

Size: 974 Bytes

Versions: 7

Compression:

Stored size: 974 Bytes

Contents

require "bundler/gem_tasks"
require "rake/testtask"

Rake::TestTask.new do |t|
  t.pattern = "test/test_*.rb"
end

desc "Start test server"
task :test_server do
  require File.expand_path 'test/app', File.dirname(__FILE__)
  App.start
end

task :default => :test

desc "generate JavaScript lib for browser"
task :jslib do
  dest = "linda.js"
  dest_min = "linda.min.js"

  require "rubygems"
  require "sinatra/websocketio"
  require "sinatra/cometio"
  require "sinatra/rocketio"
  require "sinatra/rocketio/linda"
  require "erb"

  websocketio_url = nil
  cometio_url = nil
  header = ERB.new(File.open(File.expand_path "HEADER.erb", File.dirname(__FILE__)).read).result(binding)
  js = ERB.new(Sinatra::RocketIO::Linda.javascript).result(binding)

  File.open(dest, "w+") do |f|
    f.puts header
    f.write js
  end
  puts " => #{dest}"
  File.open(dest_min, "w+") do |f|
    f.puts header
  end
  system "uglifyjs #{dest} >> #{dest_min}"
  puts " => #{dest_min}"
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sinatra-rocketio-linda-0.2.0 Rakefile
sinatra-rocketio-linda-0.1.4 Rakefile
sinatra-rocketio-linda-0.1.3 Rakefile
sinatra-rocketio-linda-0.1.2 Rakefile
sinatra-rocketio-linda-0.1.1 Rakefile
sinatra-rocketio-linda-0.1.0 Rakefile
sinatra-rocketio-linda-0.0.9 Rakefile