Skip to content
noahsug edited this page Dec 6, 2012 · 14 revisions

CIRC is written in a language called CoffeeScript. CoffeeScript is the beautiful meeting of JavaScript's object model and Python-like syntax. The language compiles into vanilla JavaScript so it can be used in conjunction with JavaScript libraries like jQuery. You can learn more here: http://coffeescript.org/.

Building from source

  1. Install CoffeeScript. Directions can be found here: http://coffeescript.org/.
  2. Clone the git repo.
  3. Run "make" in the root directory.
  4. Load the root directly as an unpacked Chrome extension (have to check the "developer mode" checkbox in chrome://extensions).

Making changes

After you make a change, first run "make" to recompile the project, then reload the app. The easiest way to reload the app is to refresh the chrome://extensions page.

If you're having trouble understanding the CoffeeScript codebase, be sure to check out the class diagram as well as the compiled JavaScript code which lives in the bin/ folder after you run make.

Testing

CIRC uses jasmine for its unit tests. The tests are written in CoffeeScript and look like this:

describe "A notice", ->

  it "is initially hidden", ->
    expect(notice.isVisible()).toBe false

  it "becomes visible after prompt() is called", ->
    notice.prompt "Device detected"
    expect(notice.isVisible()).toBe true

  it "can be manually closed with close()", ->
    notice.prompt "Device detected"
    notice.close()
    expect(notice.isVisible()).toBe false

Tests can be found in the /test directory.

To run CIRC tests, run make test then navigate to file:///path_to_circ/bin/test_runner.html in Chrome.

Clone this wiki locally