ruby2js 2.0.10 → 2.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby2js/filter/react.rb +17 -18
- data/lib/ruby2js/version.rb +1 -1
- data/ruby2js.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59d4516cb826cddf572184ad24726edede34d3a0
|
4
|
+
data.tar.gz: 2e04bc01f75f93290e4c355f86d526d0a7f3cb90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e1a1726da1fa6d7dbf53436e72890163b05a374a9ff243738d139b6c6633af719d92cba7d4bc417f5eaa6caec3d8ea819204f241d43176bf08d2be6b4caf378
|
7
|
+
data.tar.gz: d52b7d7b0170ea25de5605b691425479aba8210459d3ef8c8e9da3faddc2c34769b05bf8183bcd58ebc8dc4f18dcd84d261d18e2686068937b1d785afd4dcc6f
|
data/lib/ruby2js/filter/react.rb
CHANGED
@@ -437,6 +437,8 @@ module Ruby2JS
|
|
437
437
|
|
438
438
|
# handle nested elements
|
439
439
|
if block
|
440
|
+
# enable hashes to be passed as a variable on block calls
|
441
|
+
params[-1] = text if text and params.last == s(:nil)
|
440
442
|
|
441
443
|
# traverse down to actual list of nested statements
|
442
444
|
args = block.children[2..-1]
|
@@ -727,25 +729,22 @@ module Ruby2JS
|
|
727
729
|
child, test = test, test.children.first
|
728
730
|
end
|
729
731
|
|
730
|
-
#
|
731
|
-
# type of call, and (b) there are args present
|
732
|
-
if
|
733
|
-
child.children[0] == nil and child.children[1] =~ /^_/ and
|
734
|
-
not node.children[1].children.empty?
|
735
|
-
then
|
736
|
-
send = node.children.first.children
|
737
|
-
return super if send.length < 3
|
738
|
-
return process s(:block, s(:send, *send[0..1], *send[3..-1]),
|
739
|
-
s(:args), s(:block, s(:send, send[2], :forEach),
|
740
|
-
*node.children[1..-1]))
|
741
|
-
end
|
742
|
-
|
743
|
-
# append block as a standalone proc to wunderbar style method call
|
732
|
+
# wunderbar style calls
|
744
733
|
if child.children[0] == nil and child.children[1] =~ /^_\w/
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
734
|
+
if node.children[1].children.empty?
|
735
|
+
# append block as a standalone proc
|
736
|
+
block = s(:block, s(:send, nil, :proc), s(:args),
|
737
|
+
*node.children[2..-1])
|
738
|
+
return on_send node.children.first.updated(:send,
|
739
|
+
[*node.children.first.children, block])
|
740
|
+
else
|
741
|
+
# iterate over Enumerable arguments if there are args present
|
742
|
+
send = node.children.first.children
|
743
|
+
return super if send.length < 3
|
744
|
+
return process s(:block, s(:send, *send[0..1], *send[3..-1]),
|
745
|
+
s(:args), s(:block, s(:send, send[2], :forEach),
|
746
|
+
*node.children[1..-1]))
|
747
|
+
end
|
749
748
|
end
|
750
749
|
|
751
750
|
begin
|
data/lib/ruby2js/version.rb
CHANGED
data/ruby2js.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: ruby2js 2.0.
|
2
|
+
# stub: ruby2js 2.0.11 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "ruby2js"
|
6
|
-
s.version = "2.0.
|
6
|
+
s.version = "2.0.11"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
10
10
|
s.authors = ["Sam Ruby"]
|
11
|
-
s.date = "2015-12-
|
11
|
+
s.date = "2015-12-14"
|
12
12
|
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"
|
13
13
|
s.email = "rubys@intertwingly.net"
|
14
14
|
s.files = ["README.md", "lib/ruby2js", "lib/ruby2js.rb", "lib/ruby2js/cgi.rb", "lib/ruby2js/converter", "lib/ruby2js/converter.rb", "lib/ruby2js/converter/arg.rb", "lib/ruby2js/converter/args.rb", "lib/ruby2js/converter/array.rb", "lib/ruby2js/converter/begin.rb", "lib/ruby2js/converter/block.rb", "lib/ruby2js/converter/blockpass.rb", "lib/ruby2js/converter/boolean.rb", "lib/ruby2js/converter/break.rb", "lib/ruby2js/converter/case.rb", "lib/ruby2js/converter/casgn.rb", "lib/ruby2js/converter/class.rb", "lib/ruby2js/converter/const.rb", "lib/ruby2js/converter/cvar.rb", "lib/ruby2js/converter/cvasgn.rb", "lib/ruby2js/converter/def.rb", "lib/ruby2js/converter/defined.rb", "lib/ruby2js/converter/defs.rb", "lib/ruby2js/converter/dstr.rb", "lib/ruby2js/converter/for.rb", "lib/ruby2js/converter/hash.rb", "lib/ruby2js/converter/if.rb", "lib/ruby2js/converter/in.rb", "lib/ruby2js/converter/ivar.rb", "lib/ruby2js/converter/ivasgn.rb", "lib/ruby2js/converter/kwbegin.rb", "lib/ruby2js/converter/literal.rb", "lib/ruby2js/converter/logical.rb", "lib/ruby2js/converter/masgn.rb", "lib/ruby2js/converter/module.rb", "lib/ruby2js/converter/next.rb", "lib/ruby2js/converter/nil.rb", "lib/ruby2js/converter/nthref.rb", "lib/ruby2js/converter/opasgn.rb", "lib/ruby2js/converter/prototype.rb", "lib/ruby2js/converter/regexp.rb", "lib/ruby2js/converter/return.rb", "lib/ruby2js/converter/self.rb", "lib/ruby2js/converter/send.rb", "lib/ruby2js/converter/super.rb", "lib/ruby2js/converter/sym.rb", "lib/ruby2js/converter/undef.rb", "lib/ruby2js/converter/until.rb", "lib/ruby2js/converter/untilpost.rb", "lib/ruby2js/converter/var.rb", "lib/ruby2js/converter/vasgn.rb", "lib/ruby2js/converter/while.rb", "lib/ruby2js/converter/whilepost.rb", "lib/ruby2js/converter/xstr.rb", "lib/ruby2js/execjs.rb", "lib/ruby2js/filter", "lib/ruby2js/filter/angular-resource.rb", "lib/ruby2js/filter/angular-route.rb", "lib/ruby2js/filter/angularrb.rb", "lib/ruby2js/filter/camelCase.rb", "lib/ruby2js/filter/functions.rb", "lib/ruby2js/filter/jquery.rb", "lib/ruby2js/filter/minitest-jasmine.rb", "lib/ruby2js/filter/react.rb", "lib/ruby2js/filter/require.rb", "lib/ruby2js/filter/return.rb", "lib/ruby2js/filter/rubyjs.rb", "lib/ruby2js/filter/strict.rb", "lib/ruby2js/filter/underscore.rb", "lib/ruby2js/rails.rb", "lib/ruby2js/serializer.rb", "lib/ruby2js/sinatra.rb", "lib/ruby2js/version.rb", "ruby2js.gemspec"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby2js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|