Created
May 14, 2011 22:10
-
-
Save bhauman/972689 to your computer and use it in GitHub Desktop.
Getting Jasmine to load javascript templates Jammit style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #this file is expecting to be in spec/javascripts/support | |
| require "jammit" | |
| module Jasmine | |
| class Config | |
| def src_files | |
| if simple_config['src_files'] | |
| match_files(src_dir, simple_config['src_files'] + [package_jammit_templates]) | |
| else | |
| [] | |
| end | |
| end | |
| def package_jammit_templates | |
| filename = 'public/javascripts/compiled_templates_for_spec.js' | |
| File.open(File.expand_path("../../../#{filename}", File.dirname(__FILE__)), 'w') do |f| | |
| f.write Jammit.packager.pack_templates(:application) | |
| end | |
| filename | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment