ruby2js 1.1.5 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/README.md +5 -0
- data/lib/ruby2js/converter/class.rb +9 -2
- data/lib/ruby2js/converter/cvar.rb +16 -0
- data/lib/ruby2js/converter/cvasgn.rb +23 -0
- data/lib/ruby2js/converter/for.rb +12 -4
- data/lib/ruby2js/converter/ivar.rb +4 -1
- data/lib/ruby2js/converter/prototype.rb +17 -0
- data/lib/ruby2js/converter/regexp.rb +30 -8
- data/lib/ruby2js/converter/send.rb +26 -0
- data/lib/ruby2js/converter.rb +3 -0
- data/lib/ruby2js/filter/angularrb.rb +16 -5
- data/lib/ruby2js/filter/functions.rb +26 -4
- data/lib/ruby2js/version.rb +2 -2
- data/ruby2js.gemspec +5 -5
- metadata +59 -55
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
N2MxNDBkNGRmOTUxZmM0NjRlYWQ5N2RmODgzMTgxZTNiNDU2MDU4NA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZmFiMGY3NTM1MmViNTY4YjQ5OWQyYmMzMDQzZGYwZmFhOTY2ZDZiYg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MGMwY2ZlNWIzZWY5ZDdlOTQ1ZjUxMWNiMDZmMTczMjBiNmU0YTNjYWQ4ZDZm
|
10
|
+
MDBmZTcyZDkyNzJjMDIwNjQyN2E4ZWE3MTRhMzAwZDRhODFhY2IxNjgzYTY2
|
11
|
+
ZDUwNTg5MWJhNzRiMjlkNzE4MzEyYWJkOTc4YTQwZjFhOTNiMWY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OTc3MjViYjAyY2Q3ZWIwMzA2ZGNjMjdkMDQ0OTc2YjVkYzk0ZDc3ZmEwODcw
|
14
|
+
YThkMGVlMmViNjFkZTNmYWJjMWNhZDg2ZDI5MDQ5NzU2ODZmZjBiMzQzZTdl
|
15
|
+
Yzg1Y2FkYTI5MzM1NmY1ZTViYjJmOTRmZTgyZWQyM2JmODZiNjc=
|
data/README.md
CHANGED
@@ -133,6 +133,11 @@ the script.
|
|
133
133
|
* `[-n]` becomes `[*.length-n]` for literal values of `n`
|
134
134
|
* `[n..m]` becomes `slice(n,m+1)`
|
135
135
|
* `[n...m]` becomes `slice(n,m)`
|
136
|
+
* `.empty?` becomes `.length == 0`
|
137
|
+
* `.clear!` becomes `.length = 0`
|
138
|
+
* `.include?` becomes `.indexOf() != -1`
|
139
|
+
* `.any?` becomes `.some`
|
140
|
+
* `.all?` becomes `.every`
|
136
141
|
* `puts` becomes `console.log`
|
137
142
|
* `each` becomes `forEach` unless jquery is included
|
138
143
|
* `each_with_index` becomes `forEach`
|
@@ -27,14 +27,17 @@ module Ruby2JS
|
|
27
27
|
end
|
28
28
|
elsif m.type == :defs and m.children.first == s(:self)
|
29
29
|
# class method definition: add to prototype
|
30
|
-
s(:send, name, "#{m.children[1]}=",
|
31
|
-
s(:block, s(:send, nil, :proc), *m.children[2..-1]))
|
30
|
+
s(:prototype, s(:send, name, "#{m.children[1]}=",
|
31
|
+
s(:block, s(:send, nil, :proc), *m.children[2..-1])))
|
32
32
|
elsif m.type == :send and m.children.first == nil
|
33
33
|
# class method call
|
34
34
|
s(:send, name, *m.children[1..-1])
|
35
35
|
elsif m.type == :lvasgn
|
36
36
|
# class variable
|
37
37
|
s(:send, name, "#{m.children[0]}=", *m.children[1..-1])
|
38
|
+
elsif m.type == :cvasgn
|
39
|
+
# class variable
|
40
|
+
s(:send, name, "_#{m.children[0][2..-1]}=", *m.children[1..-1])
|
38
41
|
elsif m.type == :casgn and m.children[0] == nil
|
39
42
|
# class constant
|
40
43
|
s(:send, name, "#{m.children[1]}=", *m.children[2..-1])
|
@@ -58,6 +61,7 @@ module Ruby2JS
|
|
58
61
|
|
59
62
|
# collapse sequence of methods to a single assignment
|
60
63
|
if methods > 1
|
64
|
+
body.compact!
|
61
65
|
pairs = body[0...methods].map do |node|
|
62
66
|
s(:pair, s(:str, node.children[1].chomp('=')), node.children[2])
|
63
67
|
end
|
@@ -70,11 +74,14 @@ module Ruby2JS
|
|
70
74
|
body.unshift s(:def, parse(name), *init.children[1..-1])
|
71
75
|
|
72
76
|
begin
|
77
|
+
# save class name
|
78
|
+
class_name, @class_name = @class_name, name
|
73
79
|
# inhibit ivar substitution within a class definition. See ivars.rb
|
74
80
|
ivars, self.ivars = self.ivars, nil
|
75
81
|
parse s(:begin, *body.compact)
|
76
82
|
ensure
|
77
83
|
self.ivars = ivars
|
84
|
+
@class_name = class_name
|
78
85
|
end
|
79
86
|
end
|
80
87
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Ruby2JS
|
2
|
+
class Converter
|
3
|
+
|
4
|
+
# (cvar :@@a)
|
5
|
+
|
6
|
+
handle :cvar do |var|
|
7
|
+
if @class_name
|
8
|
+
var.to_s.sub('@@', "#{parse @class_name}._")
|
9
|
+
elsif @prototype
|
10
|
+
var.to_s.sub('@@', 'this._')
|
11
|
+
else
|
12
|
+
var.to_s.sub('@@', 'this.constructor._')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Ruby2JS
|
2
|
+
class Converter
|
3
|
+
|
4
|
+
# (cvasgn :@@a
|
5
|
+
# (int 1))
|
6
|
+
|
7
|
+
handle :cvasgn do |var, expression=nil|
|
8
|
+
if @class_name
|
9
|
+
var = var.to_s.sub('@@', "#{parse @class_name}._")
|
10
|
+
elsif @prototype
|
11
|
+
var = var.to_s.sub('@@', 'this._')
|
12
|
+
else
|
13
|
+
var = var.to_s.sub('@@', 'this.constructor._')
|
14
|
+
end
|
15
|
+
|
16
|
+
if expression
|
17
|
+
"#{ var } = #{ parse expression }"
|
18
|
+
else
|
19
|
+
var
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -10,10 +10,18 @@ module Ruby2JS
|
|
10
10
|
# (...)
|
11
11
|
|
12
12
|
handle :for do |var, expression, block|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
if expression.type == :irange
|
14
|
+
"for (var #{parse var} = #{ parse expression.children.first }; " +
|
15
|
+
"#{ parse var } <= #{ parse expression.children.last }; " +
|
16
|
+
"#{ parse var }++) {#@nl#{ scope block }#@nl}"
|
17
|
+
elsif expression.type == :erange
|
18
|
+
"for (var #{parse var} = #{ parse expression.children.first }; " +
|
19
|
+
"#{ parse var } < #{ parse expression.children.last }; " +
|
20
|
+
"#{ parse var }++) {#@nl#{ scope block }#@nl}"
|
21
|
+
else
|
22
|
+
"for (var #{parse var} in #{ parse expression }) " +
|
23
|
+
"{#@nl#{ scope block }#@nl}"
|
24
|
+
end
|
17
25
|
end
|
18
26
|
end
|
19
27
|
end
|
@@ -5,7 +5,10 @@ module Ruby2JS
|
|
5
5
|
|
6
6
|
handle :ivar do |var|
|
7
7
|
if self.ivars and self.ivars.include? var
|
8
|
-
Ruby2JS.
|
8
|
+
ruby2js = Ruby2JS::Converter.new(Ruby2JS.parse(self.ivars[var].inspect))
|
9
|
+
ruby2js.width = @width
|
10
|
+
ruby2js.enable_vertical_whitespace if @nl == "\n"
|
11
|
+
ruby2js.to_js
|
9
12
|
else
|
10
13
|
var.to_s.sub('@', 'this._')
|
11
14
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Ruby2JS
|
2
|
+
class Converter
|
3
|
+
|
4
|
+
# (prototype expr)
|
5
|
+
|
6
|
+
# NOTE: prototype is a synthetic
|
7
|
+
|
8
|
+
handle :prototype do |expr|
|
9
|
+
begin
|
10
|
+
prototype, @prototype = @prototype, true
|
11
|
+
parse(expr)
|
12
|
+
ensure
|
13
|
+
@prototype = prototype
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -5,16 +5,38 @@ module Ruby2JS
|
|
5
5
|
# (str "x")
|
6
6
|
# (regopt :i))
|
7
7
|
|
8
|
-
handle :regexp do
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
handle :regexp do |*parts, opt|
|
9
|
+
extended = false
|
10
|
+
opts = opt.children
|
11
|
+
if opts.include? :x
|
12
|
+
opts = opts.dup - [:x]
|
13
|
+
extended = true
|
14
|
+
end
|
15
|
+
|
16
|
+
if parts.all? {|part| part.type == :str}
|
17
|
+
str = parts.map {|part| part.children.first}.join
|
18
|
+
str = str.gsub(/ #.*/,'').gsub(/\s/,'') if extended
|
19
|
+
unless str.include? '/'
|
20
|
+
return "/#{ str }/#{ opts.join }"
|
21
|
+
end
|
22
|
+
str = str.inspect
|
23
|
+
else
|
24
|
+
parts.map! do |part|
|
25
|
+
if part.type == :str
|
26
|
+
str = part.children.first
|
27
|
+
str = str.gsub(/ #.*/,'').gsub(/\s/,'') if extended
|
28
|
+
str.inspect
|
29
|
+
else
|
30
|
+
parse part
|
31
|
+
end
|
15
32
|
end
|
33
|
+
str = parts.join(' + ')
|
34
|
+
end
|
35
|
+
|
36
|
+
if opts.empty?
|
37
|
+
"new RegExp(#{ str })"
|
16
38
|
else
|
17
|
-
"
|
39
|
+
"new RegExp(#{ str }, #{ opts.join.inspect})"
|
18
40
|
end
|
19
41
|
end
|
20
42
|
end
|
@@ -70,7 +70,30 @@ module Ruby2JS
|
|
70
70
|
"#{ parse receiver }#{ '.' if receiver }#{ method.to_s.sub(/=$/, ' =') } #{ parse args.first }"
|
71
71
|
|
72
72
|
elsif method == :new and receiver
|
73
|
+
# map Ruby's "Regexp" to JavaScript's "Regexp"
|
74
|
+
if receiver == s(:const, nil, :Regexp)
|
75
|
+
receiver = s(:const, nil, :RegExp)
|
76
|
+
end
|
77
|
+
|
78
|
+
# allow a RegExp to be constructed from another RegExp
|
79
|
+
if receiver == s(:const, nil, :RegExp)
|
80
|
+
if args.first.type == :regexp
|
81
|
+
opts = ''
|
82
|
+
if args.first.children.last.children.length > 0
|
83
|
+
opts = args.first.children.last.children.join
|
84
|
+
end
|
85
|
+
|
86
|
+
if args.length > 1
|
87
|
+
opts += args.last.children.last
|
88
|
+
end
|
89
|
+
|
90
|
+
return parse s(:regexp, *args.first.children[0...-1],
|
91
|
+
s(:regopt, *opts.split('').map(&:to_sym)))
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
73
95
|
args = args.map {|a| parse a}.join(', ')
|
96
|
+
|
74
97
|
if args.length > 0 or is_method?(ast)
|
75
98
|
"new #{ parse receiver }(#{ args })"
|
76
99
|
else
|
@@ -94,6 +117,9 @@ module Ruby2JS
|
|
94
117
|
else
|
95
118
|
parse s(:lvasgn, method), @state
|
96
119
|
end
|
120
|
+
elsif args.length == 1 and args.first.type == :splat
|
121
|
+
parse s(:send, s(:attr, receiver, method), :apply, receiver,
|
122
|
+
args.first.children.first)
|
97
123
|
elsif args.length > 0 and args.last.type == :splat
|
98
124
|
parse s(:send, s(:attr, receiver, method), :apply, receiver,
|
99
125
|
s(:send, s(:array, *args[0..-2]), :concat,
|
data/lib/ruby2js/converter.rb
CHANGED
@@ -107,6 +107,8 @@ require 'ruby2js/converter/case'
|
|
107
107
|
require 'ruby2js/converter/casgn'
|
108
108
|
require 'ruby2js/converter/class'
|
109
109
|
require 'ruby2js/converter/const'
|
110
|
+
require 'ruby2js/converter/cvar'
|
111
|
+
require 'ruby2js/converter/cvasgn'
|
110
112
|
require 'ruby2js/converter/def'
|
111
113
|
require 'ruby2js/converter/defs'
|
112
114
|
require 'ruby2js/converter/defined'
|
@@ -125,6 +127,7 @@ require 'ruby2js/converter/next'
|
|
125
127
|
require 'ruby2js/converter/nil'
|
126
128
|
require 'ruby2js/converter/opasgn'
|
127
129
|
require 'ruby2js/converter/orasgn'
|
130
|
+
require 'ruby2js/converter/prototype'
|
128
131
|
require 'ruby2js/converter/regexp'
|
129
132
|
require 'ruby2js/converter/return'
|
130
133
|
require 'ruby2js/converter/self'
|
@@ -84,7 +84,8 @@ module Ruby2JS
|
|
84
84
|
if name.children.first == nil
|
85
85
|
block = [node.children.last]
|
86
86
|
uses = extract_uses(block)
|
87
|
-
node =
|
87
|
+
node = s(:class, name, node.children[1],
|
88
|
+
s(:begin, *process_all(block)))
|
88
89
|
|
89
90
|
@ngClassUses -= @ngClassOmit + [name.children.last]
|
90
91
|
args = @ngClassUses.map {|sym| s(:arg, sym)} + uses
|
@@ -157,24 +158,29 @@ module Ruby2JS
|
|
157
158
|
# AppName.filter :name do
|
158
159
|
# return lambda {|input| return ... }
|
159
160
|
# end
|
161
|
+
EXPRESSION = [ :and, :array, :attr, :const, :cvar, :defined?, :dstr,
|
162
|
+
:dsym, :false, :float, :gvar, :hash, :int, :ivar, :lvar, :nil, :not,
|
163
|
+
:or, :regexp, :self, :send, :str, :sym, :true, :undefined?, :xstr ]
|
164
|
+
|
160
165
|
def ng_filter(node)
|
161
166
|
call = node.children.first
|
162
167
|
|
163
168
|
# insert return
|
164
169
|
args = process_all(node.children[1].children)
|
165
170
|
block = process_all(node.children[2..-1])
|
171
|
+
uses = @ngClassUses.uniq.map {|sym| s(:arg, sym)}
|
166
172
|
tail = [block.pop || s(:nil)]
|
167
173
|
while tail.length == 1 and tail.first.type == :begin
|
168
174
|
tail = tail.first.children.dup
|
169
175
|
end
|
170
|
-
tail.push s(:return, tail.pop)
|
176
|
+
tail.push s(:return, tail.pop) if EXPRESSION.include? tail.last.type
|
171
177
|
block.push (tail.length == 1 ? tail.first : s(:begin, *tail))
|
172
178
|
|
173
179
|
# construct a function returning a function
|
174
180
|
inner = s(:block, s(:send, nil, :lambda), s(:args, *args), *block)
|
175
181
|
outer = s(:send, s(:lvar, @ngApp), :filter, *call.children[2..-1])
|
176
182
|
|
177
|
-
node.updated nil, [outer, s(:args), s(:return, inner)]
|
183
|
+
node.updated nil, [outer, s(:args, *uses), s(:return, inner)]
|
178
184
|
end
|
179
185
|
|
180
186
|
# input:
|
@@ -232,9 +238,14 @@ module Ruby2JS
|
|
232
238
|
super
|
233
239
|
end
|
234
240
|
|
241
|
+
BUILTINS = [ :Array, :Boolean, :Date, :Error, :Function, :Infinity, :JSON,
|
242
|
+
:Math, :NaN, :Number, :Object, :RegExp, :String ]
|
243
|
+
|
235
244
|
def on_const(node)
|
236
|
-
if @ngClassUses
|
237
|
-
|
245
|
+
if @ngClassUses and not node.children.first
|
246
|
+
unless BUILTINS.include? node.children.last
|
247
|
+
@ngClassUses << node.children.last
|
248
|
+
end
|
238
249
|
end
|
239
250
|
|
240
251
|
super
|
@@ -33,6 +33,16 @@ module Ruby2JS
|
|
33
33
|
end
|
34
34
|
node.updated nil, [source, :replace, before, after]
|
35
35
|
|
36
|
+
elsif node.children[1] == :empty? and node.children.length == 2
|
37
|
+
s(:send, s(:attr, node.children[0], :length), :==, s(:int, 0))
|
38
|
+
|
39
|
+
elsif node.children[1] == :clear! and node.children.length == 2
|
40
|
+
s(:send, node.children[0], :length=, s(:int, 0))
|
41
|
+
|
42
|
+
elsif node.children[1] == :include? and node.children.length == 3
|
43
|
+
s(:send, s(:send, node.children[0], :indexOf, node.children[2]),
|
44
|
+
:!=, s(:int, -1))
|
45
|
+
|
36
46
|
elsif node.children[1] == :each
|
37
47
|
if @each # disable `each` mapping, see jquery filter for an example
|
38
48
|
super
|
@@ -98,10 +108,22 @@ module Ruby2JS
|
|
98
108
|
|
99
109
|
def on_block(node)
|
100
110
|
call = node.children.first
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
111
|
+
if [:setInterval, :setTimeout].include? call.children[1]
|
112
|
+
return super unless call.children.first == nil
|
113
|
+
block = process s(:block, s(:send, nil, :proc), *node.children[1..-1])
|
114
|
+
call.updated nil, [*call.children[0..1], block, *call.children[2..-1]]
|
115
|
+
|
116
|
+
elsif [:any?].include? call.children[1] and call.children.length == 2
|
117
|
+
call = call.updated nil, [call.children.first, :some]
|
118
|
+
node.updated nil, [call, *node.children[1..-1]]
|
119
|
+
|
120
|
+
elsif [:all?].include? call.children[1] and call.children.length == 2
|
121
|
+
call = call.updated nil, [call.children.first, :every]
|
122
|
+
node.updated nil, [call, *node.children[1..-1]]
|
123
|
+
|
124
|
+
else
|
125
|
+
super
|
126
|
+
end
|
105
127
|
end
|
106
128
|
end
|
107
129
|
|
data/lib/ruby2js/version.rb
CHANGED
data/ruby2js.gemspec
CHANGED
@@ -2,22 +2,22 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "ruby2js"
|
5
|
-
s.version = "1.
|
5
|
+
s.version = "1.2.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Sam Ruby"]
|
9
|
-
s.date = "2013-12-
|
9
|
+
s.date = "2013-12-18"
|
10
10
|
s.description = " The base package maps Ruby syntax to JavaScript semantics.\n Filters may be provided to add Ruby-specific or framework specific\n behavior.\n"
|
11
11
|
s.email = "rubys@intertwingly.net"
|
12
|
-
s.files = ["ruby2js.gemspec", "README.md", "lib/ruby2js", "lib/ruby2js/
|
12
|
+
s.files = ["ruby2js.gemspec", "README.md", "lib/ruby2js", "lib/ruby2js/rails.rb", "lib/ruby2js/version.rb", "lib/ruby2js/converter", "lib/ruby2js/converter/orasgn.rb", "lib/ruby2js/converter/kwbegin.rb", "lib/ruby2js/converter/const.rb", "lib/ruby2js/converter/return.rb", "lib/ruby2js/converter/prototype.rb", "lib/ruby2js/converter/opasgn.rb", "lib/ruby2js/converter/xstr.rb", "lib/ruby2js/converter/args.rb", "lib/ruby2js/converter/defs.rb", "lib/ruby2js/converter/literal.rb", "lib/ruby2js/converter/array.rb", "lib/ruby2js/converter/if.rb", "lib/ruby2js/converter/nil.rb", "lib/ruby2js/converter/logical.rb", "lib/ruby2js/converter/next.rb", "lib/ruby2js/converter/while.rb", "lib/ruby2js/converter/whilepost.rb", "lib/ruby2js/converter/arg.rb", "lib/ruby2js/converter/case.rb", "lib/ruby2js/converter/break.rb", "lib/ruby2js/converter/hash.rb", "lib/ruby2js/converter/for.rb", "lib/ruby2js/converter/boolean.rb", "lib/ruby2js/converter/module.rb", "lib/ruby2js/converter/var.rb", "lib/ruby2js/converter/undef.rb", "lib/ruby2js/converter/blockpass.rb", "lib/ruby2js/converter/until.rb", "lib/ruby2js/converter/regexp.rb", "lib/ruby2js/converter/untilpost.rb", "lib/ruby2js/converter/masgn.rb", "lib/ruby2js/converter/cvasgn.rb", "lib/ruby2js/converter/block.rb", "lib/ruby2js/converter/ivar.rb", "lib/ruby2js/converter/send.rb", "lib/ruby2js/converter/vasgn.rb", "lib/ruby2js/converter/defined.rb", "lib/ruby2js/converter/def.rb", "lib/ruby2js/converter/sym.rb", "lib/ruby2js/converter/cvar.rb", "lib/ruby2js/converter/ivasgn.rb", "lib/ruby2js/converter/casgn.rb", "lib/ruby2js/converter/self.rb", "lib/ruby2js/converter/andasgn.rb", "lib/ruby2js/converter/begin.rb", "lib/ruby2js/converter/dstr.rb", "lib/ruby2js/converter/class.rb", "lib/ruby2js/cgi.rb", "lib/ruby2js/converter.rb", "lib/ruby2js/filter", "lib/ruby2js/filter/return.rb", "lib/ruby2js/filter/strict.rb", "lib/ruby2js/filter/angularrb.rb", "lib/ruby2js/filter/angular-resource.rb", "lib/ruby2js/filter/functions.rb", "lib/ruby2js/filter/jquery.rb", "lib/ruby2js/filter/angular-route.rb", "lib/ruby2js/sinatra.rb", "lib/ruby2js.rb"]
|
13
13
|
s.homepage = "http://github.com/rubys/ruby2js"
|
14
14
|
s.licenses = ["MIT"]
|
15
15
|
s.require_paths = ["lib"]
|
16
|
-
s.rubygems_version = "
|
16
|
+
s.rubygems_version = "2.0.7"
|
17
17
|
s.summary = "Minimal yet extensible Ruby to JavaScript conversion."
|
18
18
|
|
19
19
|
if s.respond_to? :specification_version then
|
20
|
-
s.specification_version =
|
20
|
+
s.specification_version = 4
|
21
21
|
|
22
22
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
23
23
|
s.add_runtime_dependency(%q<parser>, [">= 0"])
|
metadata
CHANGED
@@ -1,27 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby2js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Sam Ruby
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-18 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: parser
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
25
27
|
description: ! " The base package maps Ruby syntax to JavaScript semantics.\n Filters
|
26
28
|
may be provided to add Ruby-specific or framework specific\n behavior.\n"
|
27
29
|
email: rubys@intertwingly.net
|
@@ -31,86 +33,88 @@ extra_rdoc_files: []
|
|
31
33
|
files:
|
32
34
|
- ruby2js.gemspec
|
33
35
|
- README.md
|
34
|
-
- lib/ruby2js/
|
35
|
-
- lib/ruby2js/
|
36
|
-
- lib/ruby2js/
|
37
|
-
- lib/ruby2js/
|
38
|
-
- lib/ruby2js/
|
39
|
-
- lib/ruby2js/filter/angularrb.rb
|
40
|
-
- lib/ruby2js/filter/strict.rb
|
41
|
-
- lib/ruby2js/filter/functions.rb
|
42
|
-
- lib/ruby2js/filter/angular-resource.rb
|
43
|
-
- lib/ruby2js/converter/ivasgn.rb
|
44
|
-
- lib/ruby2js/converter/self.rb
|
45
|
-
- lib/ruby2js/converter/undef.rb
|
46
|
-
- lib/ruby2js/converter/casgn.rb
|
47
|
-
- lib/ruby2js/converter/nil.rb
|
48
|
-
- lib/ruby2js/converter/logical.rb
|
49
|
-
- lib/ruby2js/converter/ivar.rb
|
50
|
-
- lib/ruby2js/converter/class.rb
|
51
|
-
- lib/ruby2js/converter/for.rb
|
52
|
-
- lib/ruby2js/converter/arg.rb
|
53
|
-
- lib/ruby2js/converter/literal.rb
|
54
|
-
- lib/ruby2js/converter/dstr.rb
|
36
|
+
- lib/ruby2js/rails.rb
|
37
|
+
- lib/ruby2js/version.rb
|
38
|
+
- lib/ruby2js/converter/orasgn.rb
|
39
|
+
- lib/ruby2js/converter/kwbegin.rb
|
40
|
+
- lib/ruby2js/converter/const.rb
|
55
41
|
- lib/ruby2js/converter/return.rb
|
56
|
-
- lib/ruby2js/converter/
|
57
|
-
- lib/ruby2js/converter/
|
58
|
-
- lib/ruby2js/converter/
|
59
|
-
- lib/ruby2js/converter/array.rb
|
60
|
-
- lib/ruby2js/converter/def.rb
|
42
|
+
- lib/ruby2js/converter/prototype.rb
|
43
|
+
- lib/ruby2js/converter/opasgn.rb
|
44
|
+
- lib/ruby2js/converter/xstr.rb
|
61
45
|
- lib/ruby2js/converter/args.rb
|
62
|
-
- lib/ruby2js/converter/regexp.rb
|
63
|
-
- lib/ruby2js/converter/var.rb
|
64
46
|
- lib/ruby2js/converter/defs.rb
|
47
|
+
- lib/ruby2js/converter/literal.rb
|
48
|
+
- lib/ruby2js/converter/array.rb
|
65
49
|
- lib/ruby2js/converter/if.rb
|
66
|
-
- lib/ruby2js/converter/
|
67
|
-
- lib/ruby2js/converter/
|
68
|
-
- lib/ruby2js/converter/
|
50
|
+
- lib/ruby2js/converter/nil.rb
|
51
|
+
- lib/ruby2js/converter/logical.rb
|
52
|
+
- lib/ruby2js/converter/next.rb
|
53
|
+
- lib/ruby2js/converter/while.rb
|
69
54
|
- lib/ruby2js/converter/whilepost.rb
|
70
|
-
- lib/ruby2js/converter/
|
71
|
-
- lib/ruby2js/converter/opasgn.rb
|
72
|
-
- lib/ruby2js/converter/begin.rb
|
73
|
-
- lib/ruby2js/converter/xstr.rb
|
74
|
-
- lib/ruby2js/converter/vasgn.rb
|
75
|
-
- lib/ruby2js/converter/block.rb
|
76
|
-
- lib/ruby2js/converter/send.rb
|
77
|
-
- lib/ruby2js/converter/sym.rb
|
55
|
+
- lib/ruby2js/converter/arg.rb
|
78
56
|
- lib/ruby2js/converter/case.rb
|
79
|
-
- lib/ruby2js/converter/
|
80
|
-
- lib/ruby2js/converter/
|
57
|
+
- lib/ruby2js/converter/break.rb
|
58
|
+
- lib/ruby2js/converter/hash.rb
|
59
|
+
- lib/ruby2js/converter/for.rb
|
60
|
+
- lib/ruby2js/converter/boolean.rb
|
81
61
|
- lib/ruby2js/converter/module.rb
|
62
|
+
- lib/ruby2js/converter/var.rb
|
63
|
+
- lib/ruby2js/converter/undef.rb
|
64
|
+
- lib/ruby2js/converter/blockpass.rb
|
82
65
|
- lib/ruby2js/converter/until.rb
|
66
|
+
- lib/ruby2js/converter/regexp.rb
|
83
67
|
- lib/ruby2js/converter/untilpost.rb
|
68
|
+
- lib/ruby2js/converter/masgn.rb
|
69
|
+
- lib/ruby2js/converter/cvasgn.rb
|
70
|
+
- lib/ruby2js/converter/block.rb
|
71
|
+
- lib/ruby2js/converter/ivar.rb
|
72
|
+
- lib/ruby2js/converter/send.rb
|
73
|
+
- lib/ruby2js/converter/vasgn.rb
|
74
|
+
- lib/ruby2js/converter/defined.rb
|
75
|
+
- lib/ruby2js/converter/def.rb
|
76
|
+
- lib/ruby2js/converter/sym.rb
|
77
|
+
- lib/ruby2js/converter/cvar.rb
|
78
|
+
- lib/ruby2js/converter/ivasgn.rb
|
79
|
+
- lib/ruby2js/converter/casgn.rb
|
80
|
+
- lib/ruby2js/converter/self.rb
|
84
81
|
- lib/ruby2js/converter/andasgn.rb
|
85
|
-
- lib/ruby2js/converter/
|
86
|
-
- lib/ruby2js/converter/
|
82
|
+
- lib/ruby2js/converter/begin.rb
|
83
|
+
- lib/ruby2js/converter/dstr.rb
|
84
|
+
- lib/ruby2js/converter/class.rb
|
87
85
|
- lib/ruby2js/cgi.rb
|
88
|
-
- lib/ruby2js/
|
89
|
-
- lib/ruby2js/
|
86
|
+
- lib/ruby2js/converter.rb
|
87
|
+
- lib/ruby2js/filter/return.rb
|
88
|
+
- lib/ruby2js/filter/strict.rb
|
89
|
+
- lib/ruby2js/filter/angularrb.rb
|
90
|
+
- lib/ruby2js/filter/angular-resource.rb
|
91
|
+
- lib/ruby2js/filter/functions.rb
|
92
|
+
- lib/ruby2js/filter/jquery.rb
|
93
|
+
- lib/ruby2js/filter/angular-route.rb
|
94
|
+
- lib/ruby2js/sinatra.rb
|
90
95
|
- lib/ruby2js.rb
|
91
96
|
homepage: http://github.com/rubys/ruby2js
|
92
97
|
licenses:
|
93
98
|
- MIT
|
99
|
+
metadata: {}
|
94
100
|
post_install_message:
|
95
101
|
rdoc_options: []
|
96
102
|
require_paths:
|
97
103
|
- lib
|
98
104
|
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
-
none: false
|
100
105
|
requirements:
|
101
106
|
- - ! '>='
|
102
107
|
- !ruby/object:Gem::Version
|
103
108
|
version: '0'
|
104
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
110
|
requirements:
|
107
111
|
- - ! '>='
|
108
112
|
- !ruby/object:Gem::Version
|
109
113
|
version: '0'
|
110
114
|
requirements: []
|
111
115
|
rubyforge_project:
|
112
|
-
rubygems_version:
|
116
|
+
rubygems_version: 2.0.7
|
113
117
|
signing_key:
|
114
|
-
specification_version:
|
118
|
+
specification_version: 4
|
115
119
|
summary: Minimal yet extensible Ruby to JavaScript conversion.
|
116
120
|
test_files: []
|