1 Copyright (c) 2013 Brandon Jones, Colin MacKenzie IV
3 This software is provided 'as-is', without any express or implied
4 warranty. In no event will the authors be held liable for any damages
5 arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it
9 freely, subject to the following restrictions:
11 1. The origin of this software must not be misrepresented; you must not
12 claim that you wrote the original software. If you use this software
13 in a product, an acknowledgment in the product documentation would be
14 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not
17 be misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
21 $:.unshift File.expand_path('.', File.dirname(__FILE__))
26 def simple_config_file
27 File.expand_path GLMatrix.base_path.join('spec/jasmine.yml')
31 class Rack::Jasmine::Runner
32 alias_method :jasmine_call, :call
40 autoload :ReleaseHelper, 'gl-matrix/release_helper'
41 autoload :Version, 'gl-matrix/version'
42 autoload :VERSION, 'gl-matrix/version'
47 GLMatrix::ReleaseHelper.release &block
51 env = Sprockets::Environment.new base_path
52 env.append_path base_path.join('src')
57 Pathname.new File.expand_path('../..', File.dirname(__FILE__))
60 # Compiles the source file to the dest file. If a block
61 # is given, the source file is yielded and replaced with
62 # the result. Returns the destination as a Pathname.
63 def compile(source = 'gl-matrix.js', dest = 'dist/gl-matrix.js')
64 dest = base_path.join dest
65 js = sprockets[source]
66 js = yield js if block_given?
68 File.open dest, "w" do |f|
72 puts "compiled #{source} to #{dest.relative_path_from base_path}"
76 def minify(source = 'gl-matrix.js', dest = 'dist/gl-matrix-min.js')
77 dest = compile source, dest do |js|
81 puts "minified #{source} to #{dest.relative_path_from base_path}"