ruby2js 3.1.1 → 3.1.2
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/vue.rb +25 -0
- data/lib/ruby2js/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bde5c5bd57b0599c6d259986d4b3ccfe3ca2a055d6d11c80730666ca4172860
|
4
|
+
data.tar.gz: e45ed225f7a1826de460f0a6370ff525465e138fe5c7feb5d8881dcb243a8ff0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b44e98bc72e235b40a53745027ed24abba5eff043ccc0923014284301ef65210a34c043878aa35d86f8234c7246e119c92f8f21ac10ec175dbd932aaa8ee7cae
|
7
|
+
data.tar.gz: 743fd931691369c969df41a88cc19fa4a7bdf465afede108bce34fbfeddfa6ef74583aea260031f38ceb4aea37fecbfa4ca0cda95f48bcb6cd15d8c1dc95b3c4
|
data/lib/ruby2js/filter/vue.rb
CHANGED
@@ -31,6 +31,8 @@ module Ruby2JS
|
|
31
31
|
@vue_reactive = []
|
32
32
|
@vue_filter_functions = false
|
33
33
|
|
34
|
+
@vue_setup = false
|
35
|
+
|
34
36
|
super
|
35
37
|
|
36
38
|
@exclude_methods << @vue_methods
|
@@ -49,6 +51,29 @@ module Ruby2JS
|
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
54
|
+
# if options[:vue_h] is set, return an array of nodes
|
55
|
+
def process(node)
|
56
|
+
return super if @vue_setup
|
57
|
+
@vue_setup = true
|
58
|
+
if @vue_h
|
59
|
+
if node.type == :begin
|
60
|
+
begin
|
61
|
+
@vue_apply = true
|
62
|
+
process s(:send, s(:block, s(:send, nil, :proc),
|
63
|
+
s(:args, s(:shadowarg, :$_)),
|
64
|
+
s(:begin, s(:lvasgn, :$_, s(:array)), process(node),
|
65
|
+
s(:return, s(:gvar, :$_)))), :[])
|
66
|
+
ensure
|
67
|
+
@vue_apply = nil
|
68
|
+
end
|
69
|
+
else
|
70
|
+
process s(:array, node)
|
71
|
+
end
|
72
|
+
else
|
73
|
+
process node
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
52
77
|
# Example conversion
|
53
78
|
# before:
|
54
79
|
# (class (const nil :Foo) (const nil :Vue) nil)
|
data/lib/ruby2js/version.rb
CHANGED
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: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|