Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Implementation of the core of Ruby's object system in JavaScript.
JavaScript Other

This branch is 523 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
site
source
test
.gitignore
CHANGELOG
Jakefile
MIT-LICENSE
README.markdown
Rakefile
jake.yml

README.markdown

JS.Class - Ruby-style JavaScript

http://jsclass.jcoglan.com

JS.Class is a JavaScript library for building object-oriented programs using Ruby idioms. It implements Ruby's core object/module/class system in JavaScript, as well as several standard Ruby libraries and various other extensions.

Distribution files

The distribution contains the following files:

  • core.js - contains Class, Module, Kernel, Singleton and Interface
  • loader.js - the Package system and dependency data for the core object system and the standard library.

The remaining files should be self-explanatory; each contains a single piece of the standard library; see the website for documentation.

Development

To hack on JS.Class you'll need to be able to build it and run the tests. You need Ruby and Jake to do this:

gem install jake
cd path/to/js.class
jake

This will build the project and create files in the build directory. To run the tests, run the test/console.js script using any JavaScript interpreter, for example:

node test/console.js

Some interpreters will skip the tests that use asynchronous APIs, but the tests should work using these JavaScript implementations:

  • Node
  • V8
  • Rhino
  • Narwhal
  • SpiderMonkey
  • Windows Script Host

To run the tests in a browser, just open the test/browser.html file. To test in a XUL environment run: xulrunner -app test/xulenv/application.ini

License

Distributed under the MIT license. Copyright (c) 2007-2010 James Coglan

Something went wrong with that request. Please try again.