Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 49 lines (43 sloc) 1.495 kb
848a1b9 @Sutto Rough shuriken lib, mixins and such fixes
authored
1 require 'rubygems'
2 require 'rake'
3
19ce330 @Sutto Add more files, gemspec
authored
4 require 'lib/shuriken'
848a1b9 @Sutto Rough shuriken lib, mixins and such fixes
authored
5
6 begin
7 require 'jeweler'
8 Jeweler::Tasks.new do |gem|
9 gem.name = "shuriken"
10 gem.summary = %Q{Simple Namespace support for JS + Other niceties, packaged as a Barista framework}
11 gem.description = %Q{Simple Namespace support for JS + Other niceties, packaged as a Barista framework}
12 gem.email = "sutto@sutto.net"
13 gem.homepage = "http://github.com/Sutto/shuriken"
14 gem.version = Shuriken::VERSION
15 gem.authors = ["Darcy Laycock"]
16 end
17 Jeweler::GemcutterTasks.new
18 rescue LoadError
19 puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
20 end
b009911 @Sutto Start writing tests for shuriken
authored
21
22 desc "Compiles the javascript from Coffeescript to Javascript"
23 task :compile_scripts do
24 Dir["coffeescripts/**/*.coffee"].each do |cs|
25 output = File.dirname(cs).gsub("coffeescripts", "javascripts")
3b025df @guitsaru Fixing tests.
guitsaru authored
26 system "coffee", "--no-wrap", "-o", output, "-c", cs
b009911 @Sutto Start writing tests for shuriken
authored
27 end
28 end
29
30 task :test => :compile_scripts do
31 require 'erb'
32 template = ERB.new(File.read("tests/template.erb"))
33 FileUtils.mkdir_p 'test-output'
34 FileUtils.rm_rf 'test-output/*'
35 Dir["tests/*.coffee"].each do |test|
36 test_name = File.basename(test, ".coffee")
37 $js_file = "#{test_name}.js"
38 File.open("test-output/#{test_name}.html", "w+") do |f|
39 f.write template.result
40 end
41 $js_file = nil
3b025df @guitsaru Fixing tests.
guitsaru authored
42 system "coffee", "--no-wrap", "-o", "test-output", "-c", test
b009911 @Sutto Start writing tests for shuriken
authored
43 end
44 end
45
8c9d01d @Sutto Watchr script for tests, write assertions
authored
46 task :watchr do
47 system "watchr tests.watchr"
48 end
Something went wrong with that request. Please try again.