|
| 1 | +#Use this file to set/override Jasmine configuration options |
| 2 | +#You can remove it if you don't need it. |
| 3 | +#This file is loaded *after* jasmine.yml is interpreted. |
| 4 | +# |
| 5 | +#Example: using a different boot file. |
| 6 | +#Jasmine.configure do |config| |
| 7 | +# config.boot_dir = '/absolute/path/to/boot_dir' |
| 8 | +# config.boot_files = lambda { ['/absolute/path/to/boot_dir/file.js'] } |
| 9 | +#end |
| 10 | +# |
| 11 | +require 'coffee-script' |
| 12 | + |
| 13 | +puts "Precompiling assets..." |
| 14 | + |
| 15 | +root = File.expand_path("../../../../lib/assets/javascripts/websocket_rails", __FILE__) |
| 16 | +destination_dir = File.expand_path("../../../../spec/javascripts/generated/assets", __FILE__) |
| 17 | + |
| 18 | +glob = File.expand_path("**/*.js.coffee", root) |
| 19 | + |
| 20 | +Dir.glob(glob).each do |srcfile| |
| 21 | + srcfile = Pathname.new(srcfile) |
| 22 | + destfile = srcfile.sub(root, destination_dir).sub(".coffee", "") |
| 23 | + FileUtils.mkdir_p(destfile.dirname) |
| 24 | + File.open(destfile, "w") {|f| f.write(CoffeeScript.compile(File.new(srcfile)))} |
| 25 | +end |
| 26 | +puts "Compiling jasmine coffee scripts into javascript..." |
| 27 | +root = File.expand_path("../../../../spec/javascripts/websocket_rails", __FILE__) |
| 28 | +destination_dir = File.expand_path("../../generated/specs", __FILE__) |
| 29 | + |
| 30 | +glob = File.expand_path("**/*.coffee", root) |
| 31 | + |
| 32 | +Dir.glob(glob).each do |srcfile| |
| 33 | + srcfile = Pathname.new(srcfile) |
| 34 | + destfile = srcfile.sub(root, destination_dir).sub(".coffee", ".js") |
| 35 | + FileUtils.mkdir_p(destfile.dirname) |
| 36 | + File.open(destfile, "w") {|f| f.write(CoffeeScript.compile(File.new(srcfile)))} |
| 37 | +end |
| 38 | + |
0 commit comments