therubyracer 0.8.0 → 0.8.1.pre1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of therubyracer might be problematic. Click here for more details.

data/History.txt DELETED
@@ -1,169 +0,0 @@
1
- === 0.8.0 2010-12-02
2
- * 3 major enhancements
3
- * every V8 Context gets its own unique access strategy
4
- * ruby methods and procs embedded in javascript always return the same function per context.
5
- * ruby classes and subclasses are now all connected via the javascript prototype chain
6
- * 3 minor enhancements
7
- * better error reporting on syntax errors
8
- * upgrade to rspec 2
9
- * several bug fixes and stability fixes
10
-
11
- === 0.7.5 1010-08-03
12
- * 4 major enhancements
13
- * upgrade to V8 2.3.3
14
- * property interceptors from ruby via [] and []=
15
- * indexed property access via [] and []=
16
- * property
17
- * 3 minor enhancements
18
- * several bugfixes
19
- * stability: eliminate many segfaults
20
- * don't enumerate property setters such as foo= from javascript
21
-
22
- === 0.7.4 2010-06-15
23
- * 1 minor enhancement
24
- * bug fix for rvm ruby installs incorrectly detected as 32bit
25
-
26
- === 0.7.3 2010-06-15
27
- * 2 minor enhancements
28
- * don't catch SystemExit and NoMemoryError
29
- * fix bug bundling gem
30
-
31
- === 0.7.2 2010-06-14
32
- * 5 major enhancements
33
- * embed ruby classes as constructors
34
- * support for rubinius
35
- * uniform backtrace() function on JSError mixes the ruby
36
- * String::NewSymbol() is now scriptable
37
- * InstanceTemplate(), PrototypeTemplate(), Inherit() methods on v8::FunctionTemplate now scriptable.
38
-
39
- * 3 minor enhancements
40
- * reuse the standard ruby object access template
41
- * fix a bunch of compile warnings
42
- * Store any ruby object in V8 with V8::C::External
43
-
44
- === 0.7.1 2010-06-03
45
- * 5 major enhancements
46
- * Function#call() now uses the global scope for 'this' by default
47
- * Function#methodcall() added to allow passing in 'this' object
48
- * Function#new() method to invoke javascript constructor from ruby
49
- * access javascript properties and call javascript methods from ruby
50
- * bundled Jasmine DOM-Less browser testing framework.
51
-
52
- * 3 minor enhancements
53
- * added Object::GetHiddenValue() to v8 metal
54
- * added Handle::IsEmpty() to v8 metal
55
- * fixed bug where iterating over arrays sometimes failed
56
- * numerous bug /segfault fixes.
57
-
58
- === 0.7.0 2010-05-31
59
- * 10 major enhancements
60
- * upgraded to V8 2.1.10
61
- * added low level scripting interface for V8 objects
62
- * ruby object property/method access is now implemented in ruby
63
- * auto-convert javascript arrays to rb arrays and vice-versa
64
- * auto-convert ruby hashes into javascript objects
65
- * auto-convert javascript Date into ruby Time object and vice versa.
66
- * better exception handling when passing through multiple language boundaries
67
- * objects maintain referential integrity when passing objects from ruby to javascript and vice-versa
68
- * added debug compile option for getting C/C++ backtraces whenever segfaults occur.
69
- * official support for REE 1.8.7
70
- * 4 minor enhancements
71
- * fixed numerous segfaults
72
- * implemented V8::Value#to_s
73
- * the global scope is available to every V8::Context as the 'scope' attribute
74
- * properly convert ruby boolean values into V8 booleans.
75
-
76
- === 0.6.3 2010-05-07
77
- * 1 minor enhancement
78
- * FIX: linkage error on OSX /usr/bin/ruby
79
-
80
- === 0.6.2 2010-05-06
81
- * 1 minor enhancement
82
- * FIX: linkage error on OSX 10.5
83
-
84
- === 0.6.1 2010-05-03
85
- * 1 major enhancement
86
- * call JavaScript functions from Ruby
87
-
88
- === 0.6.0 2010-03-31
89
- * 4 major enhancements
90
- * ruby 1.9 compatible
91
- * full featured command line bin/v8 and bin/therubyracer
92
- * self validating install (v8 --selftest)
93
- * Only dependency to build gem from source is rubygems.
94
-
95
- === 0.5.5 2010-03-15
96
- * 2 minor enhancements
97
- * fix string encoding issue that was breaking RHEL 5.x
98
- * fix pthread linking issue on RHEL 5.2
99
-
100
- === 0.5.4 2010-03-09
101
- * 1 minor enhancement
102
- * add ext directory to gem require paths which was causing problems for non-binary gems
103
-
104
- === 0.5.3 2010-03-01
105
- * 1 major enhancement
106
- * added full back trace to javascript code
107
-
108
- === 0.5.2 2010-02-26
109
- * 1 major enhancement
110
- * added javascript shell (bin/therubyracer)
111
- * 2 minor enhancements
112
- * added to_s method for embedded ruby objects
113
- * added line number and file name to error message.
114
-
115
- === 0.5.1 2010-02-17
116
- * 1 minor enhancement
117
- * fix bug in 1.8.6 by creating Object#tap if it does not exist
118
-
119
- === 0.5.0 2010-02-17
120
- * 1 major enhancement
121
- * support for Linux 64 bit
122
-
123
- === 0.4.9 2010-02-16
124
- * 1 major enhancement
125
- * support for Linux 32 bit
126
-
127
- === 0.4.8 2010-02-08
128
- * 1 major enhancement
129
- * expose line number and source name on JavascriptErrors.
130
-
131
- === 0.4.5 2010-01-18
132
- * 3 major enhancements
133
- * case munging so that ruby methods(perl_case) are accessed through javascript in camelCase.
134
- * access 0-arity ruby methods as javascript properties
135
- * invoke ruby setters from javascript as properties
136
- * 1 minor enhancements
137
- * contexts detect whether they are open or not and open when needed
138
-
139
- === 0.4.4 2010-01-14
140
- * 2 major enhancements:
141
- * Ruby objects embedded into javascript are passed back to ruby as themselves and not a wrapped V8 object wrapping a ruby object.
142
- * Use any ruby object as the scope of eval().
143
- * 5 minor enhancements:
144
- * quick and dirty V8.eval() method added
145
- * native objects have a reference to the context that created them.
146
- * context now has equality check.
147
- * expose InContext() and GetCurrent() methods.
148
- * fix a couple of segmentation faults
149
-
150
- === 0.4.3 2010-10-11
151
- * 3 major enhancements:
152
- * access properties on Ruby objects with their camel case equivalents
153
- * reflect JavaScript objects into Ruby and access their properties
154
- * load JavaScript source from an IO object or by filename
155
-
156
- === 0.4.2 2010-10-10
157
- * 1 major enhancement:
158
- * embed Ruby Objects into Javascript and call their methods
159
-
160
- === 0.4.1 2010-01-09
161
-
162
- * 3 major enhancements:
163
- * embed bare Proc and Method objects into JavaScript and call them
164
- * catch JavaScript exceptions from Ruby
165
-
166
- === 0.4.0 2009-12-21
167
-
168
- * 1 major enhancements:
169
- * evaluate JavaScript code from inside Ruby.
data/README.rdoc DELETED
@@ -1,143 +0,0 @@
1
- = therubyracer
2
-
3
- * http://github.com/cowboyd/therubyracer
4
- * http://groups.google.com/group/therubyracer
5
- * irc://irc.freenode.net/therubyracer
6
-
7
- == DESCRIPTION:
8
-
9
- Embed the V8 Javascript interpreter into Ruby.
10
-
11
-
12
- == FEATURES/PROBLEMS:
13
-
14
- * Evaluate Javascript from with in Ruby
15
- * Embed your Ruby objects into the Javascript world
16
- * Manipulate JavaScript objects and call JavaScript functions from Ruby
17
- * API compatible with the The Ruby Rhino (for JRuby: http://github.com/cowboyd/therubyrhino)
18
- * Currently ALPHA software.
19
-
20
- == SYNOPSIS:
21
- gem install therubyracer (stable)
22
- gem install therubyracer --pre (bleeding edge)
23
-
24
- # then in your ruby code
25
-
26
- require 'v8'
27
-
28
- # evaluate some simple javascript
29
-
30
- cxt = V8::Context.new
31
- cxt.eval('7 * 6') #=> 42
32
-
33
- # embed values into the scope of your context
34
-
35
- cxt['foo'] = "bar"
36
- cxt.eval('foo') # => "bar"
37
-
38
- # embed ruby code into your scope and call it from javascript
39
-
40
- cxt["say"] = lambda {|word, times| word * times}
41
- cxt.eval("say('Hello', 3)") #=> HelloHelloHello
42
-
43
- # embed a ruby object into your scope and access its properties/methods from javascript
44
-
45
- class MyMath
46
- def plus(lhs, rhs)
47
- lhs + rhs
48
- end
49
- end
50
-
51
- cxt['math'] = MyMath.new
52
- cxt.eval("math.plus(20,22)") #=> 42
53
-
54
- # make a ruby object *be* your global javascript scope.
55
- math = MyMath.new
56
- V8::Context.new(:with => math) do |cxt|
57
- cxt.eval("plus(20,22)") #=> 42
58
- end
59
-
60
- #you can do the same thing with Object#eval_js
61
-
62
- math.eval_js("plus(20,22)")
63
-
64
- ==== Different ways of loading javascript source
65
-
66
- In addition to just evaluating strings, you can also use streams such as files.
67
-
68
- # evaluate bytes read from any File/IO object:
69
- File.open("mysource.js") do |file|
70
- cxt.eval(file, "mysource.js")
71
- end
72
-
73
- # or load it by filename
74
-
75
- cxt.load("mysource.js")
76
-
77
- === Safe by default
78
-
79
- The Ruby Racer is designed to let you evaluate javascript as safely as possible unless you tell it to do something more
80
- dangerous. The default context is a hermetically sealed javascript environment with only the standard javascript objects
81
- and functions. Nothing from the ruby world is accessible at all.
82
-
83
- For ruby objects that you explicitly embed into javascript, only the +public+ methods *defined in their classes* are
84
- exposed by default. E.g.
85
-
86
- class A
87
- def a
88
- "a"
89
- end
90
- end
91
-
92
- class B < A
93
- def b
94
- "b"
95
- end
96
- end
97
-
98
-
99
- V8::Context.new do |cxt|
100
- cxt['a'] = A.new
101
- cxt['b'] = B.new
102
- cxt.eval("a.a") # => 'a'
103
- cxt.eval("b.b") # => 'b'
104
- cxt.eval("b.a") # => undef
105
- end
106
-
107
- == REQUIREMENTS:
108
-
109
- * python >= 2.5 (required to compile v8)
110
- * C++ compiler
111
-
112
- == INSTALL:
113
- * gem install therubyracer
114
-
115
- == DEVELOP
116
- * git clone git://github.com/cowboyd/therubyracer.git
117
- * cd therubyracer
118
- * rake compile
119
-
120
- == LICENSE:
121
-
122
- (The MIT License)
123
-
124
- Copyright (c) 2009,2010 Charles Lowell
125
-
126
- Permission is hereby granted, free of charge, to any person obtaining
127
- a copy of this software and associated documentation files (the
128
- 'Software'), to deal in the Software without restriction, including
129
- without limitation the rights to use, copy, modify, merge, publish,
130
- distribute, sublicense, and/or sell copies of the Software, and to
131
- permit persons to whom the Software is furnished to do so, subject to
132
- the following conditions:
133
-
134
- The above copyright notice and this permission notice shall be
135
- included in all copies or substantial portions of the Software.
136
-
137
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
138
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
139
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
140
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
141
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
142
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
143
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,13 +0,0 @@
1
-
2
- module V8
3
- module Jasmine
4
- class Context < V8::Context
5
- def initialize(*args)
6
- super(*args) do
7
- self.extend V8::Jasmine
8
- yield(self) if block_given?
9
- end
10
- end
11
- end
12
- end
13
- end