File tree 1 file changed +8
-7
lines changed 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
-
2
1
# CommonJS [ ![ Build Status] ( https://secure.travis-ci.org/cowboyd/commonjs.rb.png )] ( http://travis-ci.org/cowboyd/commonjs.rb )
3
2
4
3
Host CommonJS JavaScript environments in Ruby
@@ -14,12 +13,12 @@ able to use commonjs applications and libraries?
14
13
15
14
## Using common JS from Ruby.
16
15
17
- ` CommonJS ` now passes all of the Modules 1.0 unit tests
18
-
19
- env = CommonJS::Environment.new(:path => '/path/to/lib/dir')
20
- env.require('foo.js')
21
-
16
+ ` CommonJS ` now passes all of the Modules 1.0 unit tests.
22
17
18
+ ``` ruby
19
+ env = CommonJS ::Environment .new (:path => ' /path/to/lib/dir' )
20
+ env.require(' foo.js' )
21
+ ```
23
22
24
23
## Future directions
25
24
@@ -29,7 +28,9 @@ The plan however, is to allow you to extend your commonjs environment to have wh
29
28
interfaces you want in it. So for example, if you want to allow filesystem access, as well as
30
29
access to the process information, you would say:
31
30
32
- env.modules :filesystem, :process
31
+ ``` ruby
32
+ env.modules :filesystem , :process
33
+ ```
33
34
34
35
## Supported runtimes
35
36
You can’t perform that action at this time.
0 commit comments