Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Refactored AssetPipelineMapper #99

merged 1 commit into from Sep 7, 2012


None yet
2 participants

... for jasmine to run with sprockets without the Rails Asset Pipeline

We are testing our JS app without Rails, but with sprockets. We have a need for the tests to split out the bundled application.js into its component js files. We did this by refactoring the AssetPipelineMapper into a plugin, #src_mapper, (of sorts) that is a property of Jasmine::Config.

We modified Jasmine::Application to create the asset pipeline mapper (instead of in Jasmine::Config). Interestingly, it simplifies Config and consolidates the Asset Pipeline responsibility into the Application class.

If you want to use your own src mapper, write your own Application class, as we did in commander and assign config.src_mapper. The source mapper class is required to implement only 1 method, #files(src_files), that does the right thing.

We rewrote the AssetPipelineMapper class slightly to conform to the new interface.

It seems that you could write a FileSystemMapper class to do the right thing as well, so the refactor "feels" right.

Stop by the GP Commander desks for a demo.

Ken Mayer & Vinson Chuong pair+ken+vchuong@pivotallabs.com

Ken Mayer & Vinson Chuong Refactored AssetPipelineMapper into Jasmine::RunnerConfig -- this all…
…ows for jasmine to run with sprockets without Rails Asset Pipeline

@ragaskar ragaskar added a commit that referenced this pull request Sep 7, 2012

@ragaskar ragaskar Merge pull request #99 from pivotal-commander/master
Refactored AssetPipelineMapper

@ragaskar ragaskar merged commit 0241b43 into jasmine:master Sep 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment