Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v0.1.3.1
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 49 lines (43 sloc) 1.495 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 42 43 44 45 46 47 48
require 'rubygems'
require 'rake'

require 'lib/shuriken'

begin
  require 'jeweler'
  Jeweler::Tasks.new do |gem|
    gem.name = "shuriken"
    gem.summary = %Q{Simple Namespace support for JS + Other niceties, packaged as a Barista framework}
    gem.description = %Q{Simple Namespace support for JS + Other niceties, packaged as a Barista framework}
    gem.email = "sutto@sutto.net"
    gem.homepage = "http://github.com/Sutto/shuriken"
    gem.version = Shuriken::VERSION
    gem.authors = ["Darcy Laycock"]
  end
  Jeweler::GemcutterTasks.new
rescue LoadError
  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end

desc "Compiles the javascript from Coffeescript to Javascript"
task :compile_scripts do
  Dir["coffeescripts/**/*.coffee"].each do |cs|
    output = File.dirname(cs).gsub("coffeescripts", "javascripts")
    system "coffee", "-c", "--no-wrap", cs, "-o", output
  end
end

task :test => :compile_scripts do
  require 'erb'
  template = ERB.new(File.read("tests/template.erb"))
  FileUtils.mkdir_p 'test-output'
  FileUtils.rm_rf 'test-output/*'
  Dir["tests/*.coffee"].each do |test|
    test_name = File.basename(test, ".coffee")
    $js_file = "#{test_name}.js"
    File.open("test-output/#{test_name}.html", "w+") do |f|
      f.write template.result
    end
    $js_file = nil
    system "coffee", "-c", "--no-wrap", test, "-o", "test-output"
  end
end

task :watchr do
  system "watchr tests.watchr"
end
Something went wrong with that request. Please try again.