1 | # Contributing
|
2 |
|
3 | Please open [an issue](https://github.com/typekit/webfontloader/issues) if you find or suspect any problems. Sample pages and test cases are greatly appreciated.
|
4 |
|
5 | ## Development requirements
|
6 |
|
7 | You'll need a few rubygems to run the tests, demo server, and other rake tasks, which should be installed with [Bundler](http://gembundler.com/).
|
8 |
|
9 | $ gem install bundler
|
10 | $ bundle install
|
11 |
|
12 | To run the tests in a headless WebKit you will also need to have [PhantomJS](http://www.phantomjs.org) installed. You can install PhantomJS by downloading a binary or using HomeBrew.
|
13 |
|
14 | $ brew install phantomjs
|
15 |
|
16 | ## Building
|
17 |
|
18 | To build a JS file from source, just run rake:
|
19 |
|
20 | $ rake
|
21 |
|
22 | If you want to build a JS file with only specific modules you can specify them on the command line:
|
23 |
|
24 | $ rake compile['custom google typekit']
|
25 |
|
26 | This will compile a JS file with only the `custom`, `google` and `typekit` modules. The available modules are: `custom`, `google`, `typekit`, `ascender`, `monotype`, `fontdeck`. By default all modules are included.
|
27 |
|
28 | ## Demos
|
29 |
|
30 | A full suite of demo pages is included in this source. Here you can find some
|
31 | live examples using the JS and CSS events. Run the demo server with:
|
32 |
|
33 | $ rake demo
|
34 |
|
35 | You can also run the demos with uncompressed, debuggable code to aid in
|
36 | development. Just start the server in dev mode:
|
37 |
|
38 | $ rake demodev
|
39 |
|
40 | Browse the demos [source code](http://github.com/typekit/webfontloader/blob/master/lib/webfontloader/demo/public).
|
41 |
|
42 | ## Testing
|
43 |
|
44 | Web Font Loader has an extensive test suite that runs via Jasmine. The test suite
|
45 | should be passing before submitting a pull request, and new tests should be added for any new functionality.
|
46 |
|
47 | To run tests, open up `spec/index.html` in a browser and check the results. The
|
48 | test suite will run automatically. Again, before submitting a pull request
|
49 | please run the test suite in multiple browsers and list them in the pull request.
|
50 |
|
51 | To run tests in a headless WebKit using [PhantomJS](http://www.phantomjs.org) run:
|
52 |
|
53 | $ rake test
|